/**
 * Public Styles for InFlagranti Reservations
 * Brand colors: Dark #17181A, Gold #B8A75D, Light Gray #C4C4C4
 */

/* Base Widget Styles */
.ifr-reservation-widget {
    font-family: 'Archivo', Arial, sans-serif;
    background: #17181A;
    color: #C4C4C4;
    padding: 40px;
    border-radius: 8px;
    max-width: 1200px;
    margin: 40px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Steps */
.ifr-step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.ifr-step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideInUp 0.4s ease;
}

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

/* Step Header */
.ifr-step-header {
    margin-bottom: 30px;
    text-align: center;
}

.ifr-step-header h2 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #B8A75D;
    margin: 0 0 10px 0;
}

.ifr-step-header p {
    font-size: 16px;
    color: #C4C4C4;
    margin: 0;
}

.ifr-back-btn {
    background: transparent;
    border: 1px solid #B8A75D;
    color: #B8A75D;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: 'Archivo', Arial, sans-serif;
    margin-bottom: 20px;
}

.ifr-back-btn:hover {
    background: #B8A75D;
    color: #17181A;
    transform: translateX(-5px);
}

.ifr-icon {
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.ifr-back-btn .ifr-icon {
    margin-left: 0;
    margin-right: 8px;
}

/* Special Event Banner */
.ifr-special-event-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(184, 167, 93, 0.15) 0%, rgba(184, 167, 93, 0.05) 100%);
    border: 2px solid #B8A75D;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 25px;
    animation: bannerSlideIn 0.4s ease;
}

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

.ifr-special-event-icon {
    font-size: 28px;
    color: #B8A75D;
    animation: starPulse 2s ease infinite;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.ifr-special-event-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ifr-special-event-content strong {
    font-size: 18px;
    color: #B8A75D;
    font-weight: 600;
}

.ifr-special-event-content span {
    font-size: 14px;
    color: #C4C4C4;
}

/* Form Styles */
.ifr-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ifr-form-group-full {
    grid-column: 1 / -1;
}

.ifr-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #B8A75D;
}

.ifr-form-group .required {
    color: #B8A75D;
}

.ifr-form-group input,
.ifr-form-group select,
.ifr-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #000000;
    border: 1px solid #B8A75D;
    color: #C4C4C4;
    font-size: 15px;
    border-radius: 4px;
    font-family: 'Archivo', Arial, sans-serif;
    transition: all 0.3s ease;
}

.ifr-form-group input:focus,
.ifr-form-group select:focus,
.ifr-form-group textarea:focus {
    outline: none;
    border-color: #B8A75D;
    box-shadow: 0 0 0 3px rgba(184, 167, 93, 0.2);
    background: #17181A;
}

.ifr-form-group textarea {
    resize: vertical;
}

/* Buttons */
.ifr-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Archivo', Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ifr-btn-primary {
    background: #B8A75D;
    color: #17181A;
}

.ifr-btn-primary:hover {
    background: #d4c580;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(184, 167, 93, 0.4);
}

.ifr-btn-primary:hover .ifr-icon {
    transform: translateX(5px);
}

.ifr-btn-secondary {
    background: transparent;
    border: 2px solid #B8A75D;
    color: #B8A75D;
}

.ifr-btn-secondary:hover {
    background: #B8A75D;
    color: #17181A;
}

.ifr-form-actions {
    text-align: center;
    margin-top: 30px;
}

/* Layout Viewer */
.ifr-layout-viewer-wrapper {
    background: #000000;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #B8A75D;
}

.ifr-layout-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ifr-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #C4C4C4;
}

.ifr-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 2px solid #B8A75D;
}

.ifr-legend-color.ifr-available {
    background: rgba(139, 195, 74, 0.4);
}

.ifr-legend-color.ifr-selected {
    background: #B8A75D;
}

.ifr-legend-color.ifr-unavailable {
    background: rgba(244, 67, 54, 0.4);
}

.ifr-layout-viewer {
    position: relative;
    background: #17181A;
    margin: 0 auto;
    border: 2px solid #B8A75D;
    overflow: hidden;
}

/* Layout Objects */
.ifr-layout-object {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid #666;
    background: rgba(100, 100, 100, 0.3);
}

.ifr-layout-table {
    border-color: #8BC34A;
}

.ifr-table-available {
    background: rgba(139, 195, 74, 0.3);
    cursor: pointer;
}

.ifr-table-available:hover {
    background: rgba(139, 195, 74, 0.5);
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(139, 195, 74, 0.3);
    z-index: 10;
}

.ifr-table-selected {
    background: #B8A75D !important;
    border-color: #B8A75D !important;
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(184, 167, 93, 0.5);
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 5px 25px rgba(184, 167, 93, 0.5);
    }
    50% {
        box-shadow: 0 5px 35px rgba(184, 167, 93, 0.8);
    }
}

.ifr-table-unavailable {
    background: rgba(244, 67, 54, 0.3);
    border-color: #F44336;
    cursor: not-allowed;
    opacity: 0.5;
}

.ifr-table-not-reservable {
    background: rgba(158, 158, 158, 0.3);
    border-color: #9E9E9E;
    cursor: not-allowed;
    opacity: 0.4;
}

.ifr-table-note {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    font-size: 9px;
    color: #9E9E9E;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
}

.ifr-shape-circle {
    border-radius: 50%;
}

.ifr-table-label,
.ifr-object-label {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.ifr-table-capacity {
    font-size: 10px;
    color: #C4C4C4;
    text-align: center;
}

.ifr-non-reservable {
    background: rgba(96, 125, 139, 0.4);
    border-color: #607D8B;
    pointer-events: none;
}

/* Object Type Colors */
.ifr-layout-object[data-type="bar"] {
    background: rgba(156, 39, 176, 0.3);
    border-color: #9C27B0;
    pointer-events: none;
}

.ifr-layout-object[data-type="entrance"] {
    background: rgba(33, 150, 243, 0.3);
    border-color: #2196F3;
    pointer-events: none;
}

.ifr-layout-object[data-type="wall"] {
    background: rgba(96, 125, 139, 0.5);
    border-color: #607D8B;
    pointer-events: none;
}

.ifr-layout-object[data-type="plant"] {
    background: rgba(139, 195, 74, 0.4);
    border-color: #8BC34A;
    pointer-events: none;
}

.ifr-layout-object[data-type="pillar"] {
    background: rgba(121, 85, 72, 0.4);
    border-color: #795548;
    pointer-events: none;
}

.ifr-layout-zone {
    background: rgba(189, 189, 189, 0.15);
    border: 2px dashed rgba(158, 158, 158, 0.3);
    pointer-events: none;
}

.ifr-layout-zone .ifr-object-label {
    font-size: 14px;
    color: rgba(196, 196, 196, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.ifr-selected-tables-info {
    margin-top: 20px;
    padding: 15px;
    background: #17181A;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.ifr-selected-tables-info strong {
    color: #B8A75D;
    margin-right: 10px;
}

/* Reservation Summary */
.ifr-reservation-summary {
    background: #000000;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #B8A75D;
}

.ifr-reservation-summary h3 {
    color: #B8A75D;
    font-size: 20px;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 20px;
}

.ifr-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.ifr-summary-item {
    padding: 12px;
    background: #17181A;
    border-radius: 4px;
}

.ifr-summary-label {
    display: block;
    font-size: 12px;
    color: #B8A75D;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 5px;
}

.ifr-summary-value {
    display: block;
    font-size: 16px;
    color: #C4C4C4;
    font-weight: 500;
}

/* Success Step */
.ifr-step-success .ifr-success-content {
    text-align: center;
    padding: 40px 20px;
}

.ifr-success-icon {
    width: 80px;
    height: 80px;
    background: #B8A75D;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #17181A;
    margin: 0 auto 30px;
    animation: successBounce 0.6s ease;
}

@keyframes successBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ifr-step-success h2 {
    color: #B8A75D;
    font-size: 32px;
    margin-bottom: 15px;
}

.ifr-success-message {
    font-size: 16px;
    color: #C4C4C4;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Loading Overlay */
.ifr-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(23, 24, 26, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.ifr-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.ifr-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(184, 167, 93, 0.2);
    border-top-color: #B8A75D;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.ifr-loading-overlay p {
    margin-top: 20px;
    color: #B8A75D;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .ifr-reservation-widget {
        padding: 20px;
        margin: 20px 10px;
    }

    .ifr-step-header h2 {
        font-size: 24px;
    }

    .ifr-form-grid {
        grid-template-columns: 1fr;
    }

    .ifr-layout-viewer-wrapper {
        padding: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ifr-layout-viewer {
        max-width: 100%;
        min-width: 600px; /* Ensure layout doesn't get too cramped */
        overflow: visible;
    }

    .ifr-summary-grid {
        grid-template-columns: 1fr;
    }

    .ifr-layout-legend {
        gap: 10px;
        font-size: 12px;
    }

    .ifr-legend-item {
        font-size: 12px;
    }

    .ifr-legend-color {
        width: 16px;
        height: 16px;
    }

    .ifr-btn {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
    }

    .ifr-selected-tables-info {
        font-size: 13px;
    }

    /* Make form fields more touch-friendly */
    .ifr-form-group input,
    .ifr-form-group select,
    .ifr-form-group textarea {
        padding: 14px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .ifr-reservation-widget {
        padding: 15px;
        margin: 10px 5px;
        border-radius: 4px;
    }

    .ifr-step-header h2 {
        font-size: 20px;
    }

    .ifr-step-header p {
        font-size: 14px;
    }

    .ifr-layout-viewer {
        min-width: 500px; /* Slightly smaller for very small screens */
    }

    .ifr-layout-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ifr-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Animations for smooth transitions */
.ifr-reservation-widget * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.ifr-btn:focus,
.ifr-form-group input:focus,
.ifr-form-group select:focus,
.ifr-form-group textarea:focus {
    outline: 2px solid #B8A75D;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .ifr-reservation-widget {
        background: white;
        color: black;
        box-shadow: none;
    }

    .ifr-btn,
    .ifr-back-btn {
        display: none;
    }
}
