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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --surface: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --card-radius: 20px;
    --input-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Glassmorphism utility */
.glass {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: var(--card-radius);
}

/* Typography */
h1 { font-weight: 700; font-size: 2rem; letter-spacing: -0.025em; }
h2 { font-weight: 600; font-size: 1.5rem; }
p { color: var(--text-secondary); line-height: 1.6; }

/* Components */
.container {
    width: 100%;
    max-width: 480px; /* Centered for mobile devices */
    margin: 0 auto;
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: var(--input-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    gap: 12px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    transform: scale(0.98);
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
}

.btn-outline:active {
    background: rgba(255, 255, 255, 0.05);
}

/* Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    border-radius: var(--input-radius);
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
}

/* Navbar */
nav {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
}

.calendar-day-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-bottom: 8px;
    text-transform: uppercase;
}

.calendar-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid var(--surface-border);
    position: relative;
}

.calendar-cell:not(.empty):hover {
    background: rgba(255, 255, 255, 0.1);
}

.calendar-cell.selected {
    background: var(--primary) !important;
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.calendar-cell.today {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.calendar-cell.today.selected {
    color: white !important;
}

.calendar-cell.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
    background: transparent;
}

.calendar-cell.empty {
    border: none;
    cursor: default;
}

.calendar-cell.has-availability::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 4px;
    height: 4px;
    background: var(--success);
    border-radius: 50%;
}

/* Loading Spinner */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Availability Layout */
.availability-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.calendar-wrapper {
    flex: 1;
    min-width: 0;
}

.quick-select-sidebar {
    width: 250px;
    flex-shrink: 0;
    padding: 24px;
}

.quick-select-days {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.day-toggle {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    justify-content: space-between;
}

.day-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.day-toggle.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

@media (max-width: 768px) {
    .availability-layout {
        flex-direction: column;
    }
    .quick-select-sidebar {
        width: 100%;
    }
    .quick-select-days {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .day-toggle {
        width: calc(33.333% - 7px);
        text-align: center;
        padding: 10px 8px;
        justify-content: center;
        font-size: 0.9rem;
    }
}
