/* ===== APPOINTMENTS PAGE ENHANCEMENTS ===== */

/* Header & Actions */
.appointments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.appointments-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

.appointments-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Refresh Button */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-refresh:hover:not(:disabled) {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-refresh:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-refresh svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* New Appointment Button (Primary) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* Geocoding Progress Indicator */
.geocoding-progress {
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-left: 4px solid #f97316;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.1);
}

.progress-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #ea580c;
    font-weight: 600;
    font-size: 0.95rem;
}

.spinner-icon {
    animation: spin 1.5s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(249, 115, 22, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

/* Tabs */
.appointments-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button:hover {
    color: #E84E1B;
    background: #f8f9fa;
}

.tab-button.active {
    color: #E84E1B;
    border-bottom-color: #E84E1B;
}

/* Toggle Switch */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #E84E1B;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-weight: 500;
    color: #2B2B2B;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #2B2B2B;
    margin: 1rem 0;
}

.empty-state p {
    color: #6c757d;
}

/* Google Calendar Import */
.google-import-container {
    max-width: 800px;
    margin: 0 auto;
}

.import-header {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
}

.import-header svg {
    margin-bottom: 1rem;
    color: #4285F4;
}

.import-header h2 {
    color: #2B2B2B;
    margin: 1rem 0;
}

.import-header p {
    color: #6c757d;
}

.connect-section, .connected-section {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-box, .success-box {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #e7f3ff;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.success-box {
    background: #d4edda;
}

.info-box svg, .success-box svg {
    flex-shrink: 0;
    color: #0c63e4;
}

.success-box svg {
    color: #28a745;
}

.info-box h4, .success-box h4 {
    margin: 0 0 0.5rem 0;
    color: #2B2B2B;
}

.info-box ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.info-box li {
    margin: 0.25rem 0;
}

.btn-google {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background: #4285F4;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s;
}

.btn-google:hover:not(:disabled) {
    background: #357ae8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.import-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.date-range-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.date-range-picker label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-range-picker span {
    font-weight: 500;
    color: #2B2B2B;
}

.date-range-picker input {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Imported Events */
.imported-events {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.imported-events h3 {
    margin-bottom: 1rem;
    color: #2B2B2B;
}

.events-list {
    display: grid;
    gap: 1rem;
}

.event-card {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 0.5rem;
    border-left: 4px solid #4285F4;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.event-header h4 {
    margin: 0;
    color: #2B2B2B;
}

.event-date {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.event-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .appointments-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        justify-content: center;
    }
    
    .date-range-picker {
        grid-template-columns: 1fr;
    }
}

/* ===== SETTINGS SECTION - MOBILE FIRST ===== */

.settings-container {
    padding: 1rem;
    max-width: 100%;
}

.settings-container h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #2B2B2B;
}

.settings-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 4px solid #E84E1B;
}

.settings-section h3 {
    font-size: 1.1rem;
    margin: 0 0 1.5rem 0;
    color: #2B2B2B;
    font-weight: 600;
}

.settings-section h4 {
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem 0;
    color: #2B2B2B;
}

/* Toggle Switch in Settings */
.settings-section .toggle-switch {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.75rem;
}

.settings-section label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    cursor: pointer;
    color: #2B2B2B;
    font-weight: 500;
}

.settings-section label input[type="checkbox"] {
    cursor: pointer;
}

/* Age Limit Slider */
.age-limit-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    margin: 1rem 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.age-limit-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E84E1B;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.age-limit-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E84E1B;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.age-limit-value {
    display: block;
    text-align: center;
    font-weight: 600;
    color: #E84E1B;
    margin-top: 0.5rem;
}

/* Google Connected Section */
.google-connected-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid #d4edda;
}

.connection-status {
    color: #28a745;
    font-size: 1.1rem;
    margin: 0 0 1.5rem 0;
    font-weight: 600;
}

.import-info {
    background: #e7f3ff;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #0c63e4;
}

.import-note {
    margin: 0;
    color: #0c63e4;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Buttons in Settings */
.settings-section .btn-primary,
.settings-section .btn-danger,
.settings-section .btn-google {
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.settings-section .btn-primary {
    background: #0d6efd;
    color: white;
}

.settings-section .btn-primary:hover:not(:disabled) {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.settings-section .btn-danger {
    background: #dc3545;
    color: white;
}

.settings-section .btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.settings-section .btn-google {
    background: #4285F4;
    color: white;
}

.settings-section .btn-google:hover:not(:disabled) {
    background: #357ae8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.settings-section button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Imported Events Preview */
.imported-events-preview {
    background: white;
    padding: 1.5rem;
    border-radius: 0.375rem;
    margin-top: 1.5rem;
    border: 1px solid #dee2e6;
}

.imported-events-preview h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2B2B2B;
}

.event-preview-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid #4285F4;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-preview-card strong {
    color: #2B2B2B;
    font-weight: 600;
}

.event-preview-card span {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Spinner Small */
.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Tablet and Desktop Responsiveness */
@media (min-width: 769px) {
    .settings-container {
        max-width: 600px;
        margin: 0 auto;
    }

    .settings-section {
        padding: 2rem;
    }

    .settings-section .btn-primary,
    .settings-section .btn-danger,
    .settings-section .btn-google {
        width: auto;
        min-width: 200px;
    }
}

/* Cache Management Section */
.cache-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.btn-warning {
    background: #ffc107;
    color: #2B2B2B;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-warning:hover:not(:disabled) {
    background: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-warning:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (min-width: 769px) {
    .btn-warning {
        width: auto;
        min-width: 200px;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .appointments-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .appointments-header h1 {
        font-size: 1.75rem;
    }
    
    .appointments-actions {
        width: 100%;
    }
    
    .btn-refresh,
    .btn-primary {
        flex: 1;
        justify-content: center;
    }
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px;
    background: #f3f4f6;
    border-radius: 10px;
    width: fit-content;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn svg {
    width: 18px;
    height: 18px;
}

.view-toggle-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.view-toggle-btn.active {
    background: white;
    color: #f97316;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.view-toggle-btn.active svg {
    color: #f97316;
}
