:root {
    --charcoal-primary: #1a1a1a;
    --charcoal-secondary: #2d2d2d;
    --gold-primary: #f59e0b;
    --gold-secondary: #d97706;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--charcoal-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.card {
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gold-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gold-primary);
    color: var(--charcoal-primary);
}

.btn-primary:hover {
    background: var(--gold-secondary);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--charcoal-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.status-connected {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 20px;
    color: var(--success);
    font-size: 0.9rem;
}

.status-disconnected {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 20px;
    color: var(--error);
    font-size: 0.9rem;
}

.booking-link-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
}

.api-key-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.api-key-display {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.api-key-masked {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.api-key-new {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.api-key-new input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    background: var(--charcoal-secondary);
    border: 1px solid var(--gold-primary);
    border-radius: 6px;
    color: var(--gold-primary);
    font-size: 0.85rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.booking-link-box input {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.copy-btn {
    padding: 0.75rem 1rem;
    background: var(--gold-primary);
    border: none;
    border-radius: 6px;
    color: var(--charcoal-primary);
    cursor: pointer;
    font-weight: 500;
}

.availability-grid {
    display: grid;
    gap: 0.75rem;
}

.availability-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--charcoal-primary);
    border-radius: 8px;
}

.availability-row.disabled {
    opacity: 0.5;
}

.day-label {
    font-weight: 500;
    text-transform: capitalize;
}

.time-input {
    padding: 0.5rem;
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--charcoal-secondary);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--gold-primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.calendar-list {
    display: grid;
    gap: 0.75rem;
}

.calendar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--charcoal-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.calendar-name {
    font-weight: 500;
}

.calendar-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--gold-primary);
    color: var(--charcoal-primary);
    border-radius: 4px;
}

.bookings-list {
    display: grid;
    gap: 1rem;
}

.booking-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: var(--charcoal-primary);
    border-radius: 8px;
    border-left: 4px solid var(--gold-primary);
}

.booking-card.cancelled {
    border-left-color: var(--error);
    opacity: 0.6;
}

.booking-info h4 {
    margin-bottom: 0.25rem;
}

.booking-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.booking-actions {
    display: flex;
    align-items: center;
}

.date-picker {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.date-btn {
    padding: 0.75rem 1rem;
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    min-width: 80px;
    transition: all 0.2s;
}

.date-btn:hover {
    border-color: var(--gold-primary);
}

.date-btn.active {
    background: var(--gold-primary);
    color: var(--charcoal-primary);
    border-color: var(--gold-primary);
}

.date-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.date-btn.disabled:hover {
    border-color: var(--border-color);
}

.date-btn.blocked {
    position: relative;
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

.blocked-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
}

.date-btn .day-name {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.date-btn .day-num {
    font-size: 1.25rem;
    font-weight: 600;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.slot-btn {
    padding: 0.75rem;
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.slot-btn:hover {
    border-color: var(--gold-primary);
    background: rgba(245, 158, 11, 0.1);
}

.slot-btn.selected {
    background: var(--gold-primary);
    color: var(--charcoal-primary);
    border-color: var(--gold-primary);
}

.no-slots {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.booking-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.booking-summary {
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--gold-primary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.booking-summary h4 {
    color: var(--gold-primary);
    margin-bottom: 0.5rem;
}

.success-message {
    text-align: center;
    padding: 3rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-message h2 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.loader {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .availability-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .booking-card {
        grid-template-columns: 1fr;
    }

    .booking-link-box {
        flex-direction: column;
    }

    .page-title {
        font-size: 1.75rem;
    }
}
