/* Next Open Public Styles - Compact Horizontal Layout */

/* ==========================================================================
   Main Widget Container
   ========================================================================== */

.next-open-booking-widget {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
}

.next-open-step {
    display: none;
}

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

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

/* ==========================================================================
   Loading State
   ========================================================================== */

.next-open-loading {
    text-align: center;
    padding: 60px 20px;
}

.next-open-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Location Controls
   ========================================================================== */

.next-open-location-controls {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.next-open-use-location {
    background-color: #0066cc !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.next-open-use-location:hover {
    background-color: #0052a3 !important;
}

/* ==========================================================================
   Main Container Layout
   ========================================================================== */

.next-open-main-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

.next-open-map-container {
    flex: 0 0 48%;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.next-open-locations-container {
    flex: 1;
    min-width: 0;
}

.next-open-map {
    height: 600px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Locations List
   ========================================================================== */

.next-open-locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-locations {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ==========================================================================
   COMPACT LOCATION CARDS - Banner Style
   ========================================================================== */

.location-card.compact-layout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.location-card.compact-layout:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #0066cc;
}

/* Compact Image */
.location-image-compact {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.location-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.location-image-compact .location-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 700;
}

/* Main Content Area */
.location-main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Location Name */
.location-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

/* Address Row with Inline Distance */
.location-address-row {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.location-address-text {
    color: #666;
}

.location-distance-inline {
    color: #888;
    font-weight: 500;
}

/* Info Row - Status, Phone, Links */
.location-info-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 8px;
    line-height: 1.6;
}

.location-status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
}

.location-status-badge.open {
    background: #4CAF50;
    color: white;
}

.location-status-badge.closed {
    background: #f44336;
    color: white;
}

.location-phone-link,
.location-link {
    color: #0066cc;
    text-decoration: none;
}

.location-phone-link:hover,
.location-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   TIME SLOTS - Horizontal Layout
   ========================================================================== */

.location-timeslots-section-compact {
    margin-top: 8px;
}

.location-timeslots-loading {
    color: #999;
    font-size: 13px;
    padding: 8px 0;
    font-style: italic;
}

/* Horizontal Time Slots Container */
.timeslots-horizontal-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.time-slot-button {
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.time-slot-button:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.3);
}

.time-slot-button.selected {
    background: #004080;
    box-shadow: 0 2px 4px rgba(0, 64, 128, 0.4);
}

/* Show More Times Link */
.show-more-times-container {
    margin-top: 8px;
}

.show-more-times-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.show-more-times-link:hover {
    text-decoration: underline;
}

/* Tomorrow Section */
.tomorrow-section-compact {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.tomorrow-label-compact {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

/* No Slots Message */
.no-slots-message {
    color: #999;
    font-size: 13px;
    padding: 12px 0;
    text-align: center;
}

/* ==========================================================================
   MODAL for All Time Slots
   ========================================================================== */

.next-open-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.next-open-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

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

.next-open-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.next-open-modal-close:hover,
.next-open-modal-close:focus {
    color: #000;
}

.next-open-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3338;
    font-size: 24px;
}

.all-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.modal-slot {
    cursor: pointer !important;
}

/* ==========================================================================
   Back Button
   ========================================================================== */

.next-open-back-btn {
    background-color: #757575;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.next-open-back-btn:hover {
    background-color: #616161;
}

/* ==========================================================================
   Booking Summary
   ========================================================================== */

.next-open-booking-summary {
    background-color: #E8F5E9;
    border-left: 4px solid #4CAF50;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.next-open-booking-summary h4 {
    margin: 0 0 15px 0;
    color: #4CAF50;
}

.summary-item {
    margin: 8px 0;
    color: #333;
    font-size: 15px;
}

.summary-item strong {
    color: #2E7D32;
}

/* ==========================================================================
   Customer Information Form
   ========================================================================== */

.next-open-form {
    max-width: 600px;
}

.next-open-form .form-field {
    margin-bottom: 25px;
}

.next-open-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.next-open-form input,
.next-open-form select,
.next-open-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.next-open-form input:focus,
.next-open-form select:focus,
.next-open-form textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-actions {
    margin-top: 30px;
}

.next-open-submit-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.next-open-submit-btn:hover {
    background-color: #388E3C;
}

.next-open-submit-btn:disabled {
    background-color: #BDBDBD;
    cursor: not-allowed;
}

/* ==========================================================================
   Success/Confirmation Page
   ========================================================================== */

.next-open-success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 100px;
    height: 100px;
    background-color: #4CAF50;
    color: white;
    font-size: 60px;
    line-height: 100px;
    text-align: center;
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.next-open-success-message h2 {
    color: #4CAF50;
    margin-bottom: 15px;
}

.next-open-success-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

.confirmation-details {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 30px auto;
    max-width: 500px;
    text-align: left;
}

.confirmation-details p {
    margin: 10px 0;
    color: #333;
}

.confirmation-details strong {
    color: #0066cc;
}

/* ==========================================================================
   Error Messages
   ========================================================================== */

.next-open-error {
    background-color: #FFEBEE;
    border-left: 4px solid #f44336;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 4px;
    color: #C62828;
    animation: slideDown 0.3s ease;
}

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

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Tablets and smaller */
@media screen and (max-width: 1200px) {
    .next-open-main-container {
        flex-direction: column;
    }
    
    .next-open-map-container {
        flex: 1;
        width: 100%;
        position: relative;
    }
    
    .next-open-map {
        height: 400px;
    }
}

/* Mobile landscape and smaller */
@media screen and (max-width: 768px) {
    .next-open-booking-widget {
        padding: 15px;
    }
    
    .location-card.compact-layout {
        flex-direction: column;
    }
    
    .location-image-compact {
        width: 100%;
        height: 120px;
    }
    
    .location-address-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .location-distance-inline {
        display: block;
    }
    
    .location-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .timeslots-horizontal-container {
        gap: 6px;
    }
    
    .time-slot-button {
        font-size: 13px;
        padding: 7px 12px;
    }
    
    .next-open-map {
        height: 300px;
    }
}

/* Mobile portrait */
@media screen and (max-width: 480px) {
    .location-card.compact-layout {
        padding: 10px;
    }
    
    .location-image-compact {
        height: 100px;
    }
    
    .location-name {
        font-size: 16px;
    }
    
    .timeslots-horizontal-container {
        gap: 4px;
    }
    
    .time-slot-button {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .next-open-submit-btn {
        width: 100%;
        padding: 15px 20px;
    }
    
    .success-icon {
        width: 80px;
        height: 80px;
        font-size: 48px;
        line-height: 80px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .next-open-booking-widget {
        box-shadow: none;
    }
    
    .next-open-back-btn,
    .next-open-use-location,
    .time-slot-button,
    .show-more-times-link {
        display: none;
    }
    
    .next-open-map {
        display: none;
    }
}
