/* Ironcrest Booking Calendar - Material Design Styles */

:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --secondary-color: #424242;
    --accent-color: #ff5722;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --background: #fafafa;
    --surface: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --divider: #e0e0e0;
    --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-2);
}

.header h1 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Booking Form */
.booking-form {
    background: var(--surface);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.steps-container {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    width: 400%;
}

/* Steps */
.step {
    min-width: 25%;
    padding: 0 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.steps-container[data-step="0"] {
    transform: translateX(0%);
}

.steps-container[data-step="1"] {
    transform: translateX(-25%);
}

.steps-container[data-step="2"] {
    transform: translateX(-50%);
}

.steps-container[data-step="3"] {
    transform: translateX(-75%);
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--divider);
}

.step-header .material-icons {
    color: var(--primary-color);
    font-size: 32px;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.back-button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.back-button:hover {
    background: rgba(25, 118, 210, 0.1);
}

.back-button .material-icons {
    font-size: 24px;
}

.selected-date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.selected-date-display .material-icons {
    font-size: 18px;
}

/* Calendar */
.calendar-container {
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e3f2fd 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
}

.calendar-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary-color);
    padding: 12px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--divider);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.3s ease-out backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger animation for calendar days */
.calendar-day:nth-child(1) { animation-delay: 0.02s; }
.calendar-day:nth-child(2) { animation-delay: 0.04s; }
.calendar-day:nth-child(3) { animation-delay: 0.06s; }
.calendar-day:nth-child(4) { animation-delay: 0.08s; }
.calendar-day:nth-child(5) { animation-delay: 0.10s; }
.calendar-day:nth-child(6) { animation-delay: 0.12s; }
.calendar-day:nth-child(7) { animation-delay: 0.14s; }

.calendar-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.1) 0%, rgba(66, 165, 245, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.calendar-day:hover::before:not(.disabled) {
    opacity: 1;
}

.calendar-day:hover:not(.disabled):not(.selected) {
    background: linear-gradient(135deg, #42a5f5 0%, #1976d2 100%);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    border-color: transparent;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
    border-color: transparent;
    transform: scale(1.05);
}

.calendar-day.selected::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.calendar-day.disabled {
    color: var(--text-secondary);
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-color: #e0e0e0;
}

.calendar-day.disabled::before {
    display: none;
}

.calendar-day.other-month {
    opacity: 0.3;
}

/* Time Slots */
.selected-date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--primary-light);
    color: white;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.time-slot {
    padding: 16px;
    border: 2px solid var(--divider);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.time-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.05) 0%, rgba(66, 165, 245, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.time-slot:hover::before {
    opacity: 1;
}

.time-slot:hover:not(.selected):not(.unavailable) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #42a5f5 0%, #1976d2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.3);
}

.time-slot.selected {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.4);
    transform: translateY(-2px);
}

.time-slot.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 14px;
    font-weight: bold;
}

.time-slot.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    border-color: #e0e0e0;
    background: var(--background);
}

/* Booking Summary */
.booking-summary {
    background: var(--background);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary-color);
}

.booking-summary h3 {
    font-size: 1.125rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 1rem;
}

.summary-item .material-icons {
    color: var(--primary-color);
    font-size: 20px;
}

/* Form */
.info-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.required {
    color: var(--error-color);
}

.form-group input,
.form-group textarea {
    padding: 14px 16px;
    border: 2px solid var(--divider);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

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

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-1);
}

.button.primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.button.secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--divider);
}

.button.secondary:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--primary-color);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button .material-icons {
    font-size: 20px;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-primary);
}

.icon-button:hover {
    background: var(--background);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.button-group .button {
    flex: 1;
}

/* Confirmation */
.confirmation-success {
    text-align: center;
    padding: 20px;
}

.success-icon {
    margin: 20px 0;
}

.success-icon .material-icons {
    font-size: 80px;
    color: var(--success-color);
}

.confirmation-success h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.confirmation-success > p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.confirmation-details {
    background: var(--background);
    padding: 24px;
    border-radius: 8px;
    margin: 24px 0;
    text-align: left;
}

.confirmation-details h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--divider);
}

.detail-item:last-child {
    border-bottom: none;
}

.confirmation-message {
    margin: 24px 0;
    color: var(--text-secondary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    font-size: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.toast.hidden {
    display: none;
}

.toast.error {
    background: var(--error-color);
    color: white;
}

.toast .material-icons {
    font-size: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 30px 16px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .booking-form {
        padding: 20px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .step-header h2 {
        font-size: 1.25rem;
    }

    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
