/* ==========================================
   Variables
   ========================================== */
:root {
    --bg: #0a0a0a;
    --bg-raised: #141414;
    --bg-input: #1a1a1a;
    --border: #2a2a2a;
    --text: #fafafa;
    --text-muted: #888;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 8px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================
   Reset
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ==========================================
   Login Screen
   ========================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.login-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.login-step {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    min-height: 1.25rem;
}

/* ==========================================
   Header
   ========================================== */
.header {
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.125rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================
   Container
   ========================================== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* ==========================================
   Tabs
   ========================================== */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-raised);
    padding: 0.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--bg);
    color: var(--text);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================
   Calendar
   ========================================== */
.calendar-wrapper {
    position: relative;
    background: var(--bg-raised);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 500px;
}

.calendar-wrapper iframe {
    display: block;
    width: 100%;
    border: none;
    background: white;
}

.calendar-desktop iframe {
    height: 550px;
}

.calendar-mobile iframe {
    height: 450px;
}

.calendar-desktop {
    display: block;
}

.calendar-mobile {
    display: none;
}

@media (max-width: 600px) {
    .calendar-desktop { display: none; }
    .calendar-mobile { display: block; }
    .calendar-wrapper { min-height: 450px; }
}

.calendar-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-raised);
}

.calendar-placeholder.hidden {
    display: none;
}

/* ==========================================
   Form Elements
   ========================================== */
input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.optional {
    font-weight: 400;
    opacity: 0.6;
}

/* ==========================================
   Booking Form
   ========================================== */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* Ensure hidden form groups get flex layout when shown */
.form-group[style*="block"] {
    display: flex !important;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 400px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Buttons
   ========================================== */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    padding: 0.75rem 1.5rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.btn-text:hover {
    color: var(--text);
}

/* Loading state */
.btn-primary .btn-loading {
    display: none;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loading {
    display: inline;
}

/* ==========================================
   Bookings List
   ========================================== */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

.booking-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.booking-info h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.booking-dates {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.booking-notes {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    opacity: 0.7;
}

.booking-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.booking-actions button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: calc(var(--radius) - 2px);
}

/* ==========================================
   Modal
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-small {
    max-width: 320px;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-small h3 {
    margin-bottom: 0.5rem;
}

.delete-details {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-small .modal-actions {
    justify-content: center;
}

/* ==========================================
   Messages
   ========================================== */
.form-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    display: none;
    margin-top: 1rem;
}

.form-message.show {
    display: block;
}

.form-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}
