/**
 * Booking System CSS
 * Modern, minimalist, and clean responsive re-design
 * Cache refresh: 2025-01-24 19:05
 */

/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables for easy theme management */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #6EC1E4;
    --background-color: #f7f8fa;
    --text-color: #2d3748;
    --subtle-text-color: #718096;
    --border-color: #e2e8f0;
    --card-background: #ffffff;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --transition-speed: 0.3s;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main container */
.booking-container, .admin-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: var(--card-background);
}

/* --- MOBILE FIRST STYLES (< 768px) --- */

/* Header */
.booking-header {
    background-color: var(--primary-color);
    color: white;
    padding: 25px 15px;
    text-align: center;
}
.avatar-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}
.profile-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 10px 0;
}
.profile-bio {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Content and Sections */
.booking-content, .admin-container {
    padding: 20px 15px;
}
.section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}
.section:last-child { border-bottom: none; }
.section h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
}

/* Meeting Types */
.meeting-types {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.meeting-type-btn {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    font-family: inherit;
}

/* Calendar - Improved Phase 1 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 12px;
}
.calendar-day {
    aspect-ratio: 1;
    font-size: 0.9rem;
    border-radius: 6px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    background: white;
}

.calendar-day:hover:not(.disabled):not(.day-off) {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(110, 193, 228, 0.3);
}

/* Time Slots - Improved Phase 1 */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px 0;
}
.time-slot {
    background: white;
    border: 2px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-align: center;
    font-size: 0.95rem;
}

.time-slot:hover:not(.unavailable) {
    border-color: var(--secondary-color);
    background: rgba(110, 193, 228, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 193, 228, 0.15);
}

/* Forms & Inputs */
.form-input, .setting-input {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px; /* Larger, more readable text */
    min-height: 56px; /* Taller touch target */
    transition: all 0.3s ease;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

/* Focus styles for better UX */
.form-input:focus, .setting-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
    outline: none;
    background-color: white;
}

/* Placeholder styling */
.form-input::placeholder, .setting-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Hover state for inputs */
.form-input:hover:not(:focus), .setting-input:hover:not(:focus) {
    border-color: #a0aec0;
}
.form-group, .setting-group {
    margin-bottom: 25px;
}

/* Custom Select Wrapper */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23718096" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

.timezone-dropdown {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px; /* Make space for the arrow */
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    min-height: 44px; /* Touch target */
    transition: all var(--transition-speed) ease;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}


/* Buttons - Enhanced UX */
.btn-primary, .btn-secondary {
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 600;
    width: 100%;
    min-height: 56px; /* Match input height */
    transition: all 0.25s ease;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

/* Enhanced primary button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(74, 144, 226, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

/* Modals (Success/Error/Loading) */
.loading-overlay, .error-message, .success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
    transition: opacity var(--transition-speed) ease;
}
.loading-content, .error-content, .success-content {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.success-actions {
    flex-direction: column;
    gap: 12px;
}

/* Admin Nav */
.admin-nav ul {
    flex-direction: column;
    gap: 5px;
}
.admin-nav a {
    text-align: center;
}

/* Admin Tables */
.recent-bookings {
    overflow: hidden;
}
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}
.bookings-list table {
    width: 100%;
    min-width: 600px; /* Force scroll on mobile */
    border-collapse: collapse;
}
.booking-item {
    display: block;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}
.booking-details h4 { font-size: 1rem; }
.booking-meta { font-size: 0.85rem; }
.booking-actions { margin-top: 10px; }


/* --- TABLET STYLES (768px and up) --- */
@media (min-width: 768px) {
    .booking-content, .admin-container {
        padding: 40px 30px;
    }
    .profile-info h1 { font-size: 1.8rem; }
    .avatar-img { width: 80px; height: 80px; }

    .meeting-types {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .btn-primary, .btn-secondary {
        width: auto;
    }
    .success-actions {
        flex-direction: row;
    }
    .loading-content, .error-content, .success-content {
        width: auto;
    }
    .admin-nav ul {
        flex-direction: row;
        gap: 10px;
    }
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- DESKTOP STYLES (1024px and up) --- */
@media (min-width: 1024px) {
    .booking-container {
        min-height: auto;
        border-radius: var(--border-radius);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.07), 0 5px 10px -5px rgba(0, 0, 0, 0.04);
        margin: 40px auto;
    }
    .booking-header {
        padding: 40px;
    }
    .booking-content {
        padding: 50px;
    }
    .profile-info h1 { font-size: 2.2rem; font-weight: 800; }
    .settings-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}


/* --- SHARED STYLES (already good, minor tweaks) --- */

/* Access Denied Page Styles */
.access-denied {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    z-index: 1000;
}

.access-denied-content {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 450px;
    width: 90%;
}

.access-denied-content h1 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.access-denied-content p {
    color: var(--subtle-text-color);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.access-denied-content .btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background var(--transition-speed);
}

.access-denied-content .btn-primary:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Base styles from original that are kept */
.profile-section, .profile-avatar, .calendar-status, .profile-links, .social-link, .timezone-note, .calendar-container, .calendar-day-header, .time-slots-container, .selected-date, .loading-slots, .location-options, .location-option, .location-icon, .location-text, .phone-input, .booking-form, .form-group, .spinner, .success-icon, .error-content h3, .success-content h3, .error-content p, .success-content p, .loader, .text-center {
    /* These styles are generally fine, media queries will handle layout */
}

/* Calendar Header */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.month-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.month-title:hover {
    background-color: var(--background-color);
}

.month-title svg {
    width: 16px;
    height: 16px;
    color: var(--subtle-text-color);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--subtle-text-color);
    width: 36px;
    height: 36px;
}
.nav-btn:hover {
    background-color: var(--background-color);
    color: var(--text-color);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Social Link Button */
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Add transitions for smoothness - Phase 1 optimized */
.social-link, .meeting-type-btn, .nav-btn, .calendar-day, .time-slot, .location-option, .btn-primary, .btn-secondary {
    transition: all 0.2s ease;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.3);
    background: linear-gradient(135deg, #3a7bc8, #5fb1d3);
}
.meeting-type-btn:hover:not(.active) {
    transform: translateY(-2px);
    border-color: var(--secondary-color);
    background: rgba(110, 193, 228, 0.05);
    box-shadow: 0 4px 12px rgba(110, 193, 228, 0.15);
}

.location-option:hover {
    transform: translateY(-1px);
    border-color: var(--secondary-color);
    background: rgba(110, 193, 228, 0.05);
    box-shadow: var(--shadow);
}
.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

/* Day off styling */
.calendar-day.day-off {
    color: #ccc;
    cursor: not-allowed;
    background: #f5f5f5;
    text-decoration: line-through;
}
.day-off-message {
    grid-column: span 2;
    text-align: center;
    padding: 40px 20px;
    color: var(--subtle-text-color);
    font-style: italic;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Active/Selected States */
.meeting-type-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(1px);
}

.time-slot.selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.3);
    font-weight: 600;
}

.time-slot.selected:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}
.calendar-day.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
    position: relative;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.calendar-day.selected::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

/* Disabled States */
.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: transparent;
}
.time-slot.unavailable {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #f0f0f0;
}
/* Improved disabled state */
.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(148, 163, 184, 0.2);
}

/* Button with loader spacing */
.btn-primary .loader {
    margin-left: 8px;
}

/* Form improvements */
.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: var(--text-color);
    font-size: 15px;
}

/* Character counter for textarea */
.form-group {
    position: relative;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Better form spacing */
.booking-form {
    margin-top: 8px;
}

/* Improve phone input styling */
.phone-input {
    margin-top: 12px;
    padding: 12px;
    background: rgba(110, 193, 228, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(110, 193, 228, 0.2);
}

/* Enhanced Success Message Styles */
.success-message {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-content {
    text-align: center;
    position: relative;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin: 0 auto 20px auto;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    animation: bounceIn 0.6s ease-out 0.2s both;
    position: relative;
}

.success-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    opacity: 0.2;
    transform: scale(1.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.2);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.1;
    }
}

.success-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    animation: slideInDown 0.5s ease-out 0.3s both;
}

#success-text {
    background: rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0 24px 0;
    text-align: left;
    line-height: 1.8;
    animation: slideInUp 0.5s ease-out 0.4s both;
}

#success-text strong {
    color: var(--text-color);
    font-weight: 600;
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
}

.success-details-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.success-detail-row {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.success-detail-row::before {
    content: attr(data-emoji);
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    animation: slideInUp 0.5s ease-out 0.5s both;
}

.success-actions .btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.3s ease;
}

.success-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.success-actions .btn-secondary {
    color: var(--subtle-text-color);
    border-color: var(--border-color);
    transition: all 0.3s ease;
}

.success-actions .btn-secondary:hover {
    color: var(--text-color);
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility enhancements */
.success-message[role="alert"] .success-content {
    outline: none;
}

.success-icon[aria-label] {
    position: relative;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .success-content {
        padding: 24px;
    }
    
    .success-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
        margin-bottom: 16px;
    }
    
    .success-content h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    #success-text {
        padding: 16px;
        margin: 16px 0 20px 0;
        font-size: 14px;
        line-height: 1.6;
    }
    
    .success-actions {
        margin-top: 20px;
    }
}

/* Desktop responsive adjustments */
@media (min-width: 768px) {
    .success-actions {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
    }
    
    .success-actions .btn-primary,
    .success-actions .btn-secondary {
        min-width: 160px;
    }
}

/* Print styles */
@media print {
    body { background: white; }
    .booking-container { box-shadow: none; }
    .booking-header { background: white; color: black; border-bottom: 1px solid #ccc; }
    .btn-primary, .btn-secondary, .nav-btn { display: none; }
    .success-icon { background: #10b981 !important; }
    .success-message { animation: none !important; }
    * { animation: none !important; }
}
