/**
 * COIT Omaha - Callback Modal & After-Hours CTA Styles
 *
 * Brand Colors:
 * - Primary: #ca3c29 (red/orange)
 * - Hover: #a02f1f
 * - Accent: #D7AD29 (gold)
 *
 * Mobile-first design (70%+ traffic is mobile)
 */

/* ============================================
   MODAL OVERLAY & CONTAINER
   ============================================ */

.callback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.callback-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.callback-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.callback-modal-overlay.active .callback-modal-content {
    transform: scale(1) translateY(0);
}

/* ============================================
   MODAL CLOSE BUTTON
   ============================================ */

.callback-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10;
}

.callback-modal-close:hover {
    background: #ca3c29;
    color: #fff;
}

.callback-modal-close:focus {
    outline: 2px solid #D7AD29;
    outline-offset: 2px;
}

/* ============================================
   MODAL HEADER
   ============================================ */

.callback-modal-header {
    padding: 32px 24px 16px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.callback-modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin: 0 0 8px;
}

.callback-modal-subtitle {
    font-size: 16px;
    color: #555;
    margin: 0 0 8px;
    line-height: 1.5;
}

.callback-modal-hours {
    font-size: 14px;
    color: #888;
    margin: 0;
    font-weight: 500;
}

/* ============================================
   CALLBACK FORM
   ============================================ */

.callback-form {
    padding: 24px;
}

.callback-form-group {
    margin-bottom: 20px;
}

.callback-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.callback-form-group .required {
    color: #ca3c29;
}

.callback-form-group input,
.callback-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
    color: #111;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.callback-form-group input:focus,
.callback-form-group textarea:focus {
    outline: none;
    border-color: #ca3c29;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(202, 60, 41, 0.1);
}

.callback-form-group input::placeholder,
.callback-form-group textarea::placeholder {
    color: #999;
}

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

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.callback-submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #ca3c29;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    min-height: 56px;
    touch-action: manipulation;
}

.callback-submit-btn:hover {
    background: #a02f1f;
}

.callback-submit-btn:active {
    transform: scale(0.98);
}

.callback-submit-btn:focus {
    outline: 2px solid #D7AD29;
    outline-offset: 2px;
}

.callback-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.callback-form-note {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin: 16px 0 0;
}

/* ============================================
   SUCCESS STATE
   ============================================ */

.callback-success {
    padding: 48px 24px;
    text-align: center;
}

.callback-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
}

.callback-success h3 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin: 0 0 12px;
}

.callback-success p {
    font-size: 16px;
    color: #555;
    margin: 0 0 24px;
    line-height: 1.5;
}

.callback-close-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #ca3c29;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.callback-close-btn:hover {
    background: #a02f1f;
}

/* ============================================
   AFTER-HOURS CTA REPLACEMENTS
   ============================================ */

.after-hours-cta-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.after-hours-btn {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    touch-action: manipulation;
    white-space: nowrap;
}

.after-hours-book {
    background: #D7AD29;
    color: #000;
}

.after-hours-book:hover {
    background: #c49b1f;
    transform: translateY(-1px);
}

.after-hours-callback {
    background: #ca3c29;
    color: #fff;
}

.after-hours-callback:hover {
    background: #a02f1f;
    transform: translateY(-1px);
}

/* ============================================
   HEADER AFTER-HOURS STYLING
   ============================================ */

.after-hours-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.after-hours-status {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 20px;
}

.after-hours-btn-small {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #ca3c29;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.after-hours-btn-small:hover {
    background: #a02f1f;
}

/* ============================================
   STICKY BUTTON AFTER-HOURS STYLING
   ============================================ */

.after-hours-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 0;
    z-index: 9999;
    padding: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.after-hours-sticky .after-hours-btn {
    flex: 1;
    border-radius: 0;
    min-height: 56px;
    font-size: 16px;
}

.after-hours-sticky .after-hours-book {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   EXIT POPUP AFTER-HOURS
   ============================================ */

.after-hours-note {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

/* ============================================
   BODY CLASS FOR AFTER-HOURS MODE
   ============================================ */

body.after-hours-mode .sticky-phone-button {
    display: none !important;
}

body.after-hours-mode .sticky-phone {
    display: none !important;
}

/* Mobile: hide original sticky call button in after-hours mode */
body.after-hours-mode .sticky-call {
    display: none !important;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .callback-modal-content {
        background: #1a1a1a;
    }

    .callback-modal-header {
        border-bottom-color: #333;
    }

    .callback-modal-header h2 {
        color: #f0f0f0;
    }

    .callback-modal-subtitle {
        color: #aaa;
    }

    .callback-modal-hours {
        color: #777;
    }

    .callback-modal-close {
        background: #333;
        color: #aaa;
    }

    .callback-modal-close:hover {
        background: #ca3c29;
        color: #fff;
    }

    .callback-form-group label {
        color: #ddd;
    }

    .callback-form-group input,
    .callback-form-group textarea {
        background: #2a2a2a;
        border-color: #444;
        color: #f0f0f0;
    }

    .callback-form-group input:focus,
    .callback-form-group textarea:focus {
        background: #333;
        border-color: #ca3c29;
    }

    .callback-form-group input::placeholder,
    .callback-form-group textarea::placeholder {
        color: #666;
    }

    .callback-form-note {
        color: #777;
    }

    .callback-success h3 {
        color: #f0f0f0;
    }

    .callback-success p {
        color: #aaa;
    }

    .after-hours-status {
        background: #333;
        color: #aaa;
    }

    .after-hours-sticky {
        background: #1a1a1a;
    }
}

/* ============================================
   MOBILE RESPONSIVE (Mobile-First)
   ============================================ */

/* Small phones */
@media (max-width: 375px) {
    .callback-modal-content {
        border-radius: 12px;
    }

    .callback-modal-header {
        padding: 24px 16px 12px;
    }

    .callback-modal-header h2 {
        font-size: 24px;
    }

    .callback-form {
        padding: 16px;
    }

    .callback-form-group input,
    .callback-form-group textarea {
        padding: 12px 14px;
        font-size: 16px;
    }

    .callback-submit-btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    .after-hours-cta-wrapper {
        flex-direction: column;
        width: 100%;
    }

    .after-hours-btn {
        width: 100%;
    }

    .after-hours-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Tablet and larger phones */
@media (min-width: 376px) and (max-width: 768px) {
    .callback-modal-content {
        max-width: 440px;
    }

    .after-hours-cta-wrapper {
        justify-content: center;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .callback-modal-overlay {
        padding: 24px;
    }

    .callback-modal-content {
        max-width: 500px;
    }

    .callback-modal-header {
        padding: 40px 32px 20px;
    }

    .callback-modal-header h2 {
        font-size: 32px;
    }

    .callback-form {
        padding: 32px;
    }

    /* Desktop: hide sticky replacement, show inline */
    .after-hours-sticky {
        position: static;
        display: inline-flex;
        box-shadow: none;
        background: transparent;
        gap: 12px;
    }

    .after-hours-sticky .after-hours-btn {
        flex: none;
        border-radius: 8px;
        min-height: 48px;
    }

    .after-hours-sticky .after-hours-book {
        border-right: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .callback-modal-overlay,
    .callback-modal-content,
    .callback-modal-close,
    .callback-form-group input,
    .callback-form-group textarea,
    .callback-submit-btn,
    .after-hours-btn {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .callback-form-group input,
    .callback-form-group textarea {
        border-width: 3px;
    }

    .callback-submit-btn,
    .after-hours-btn,
    .callback-close-btn {
        border: 2px solid currentColor;
    }
}

/* Focus visible for keyboard navigation */
.callback-form-group input:focus-visible,
.callback-form-group textarea:focus-visible,
.callback-submit-btn:focus-visible,
.callback-close-btn:focus-visible,
.after-hours-btn:focus-visible,
.after-hours-btn-small:focus-visible {
    outline: 3px solid #D7AD29;
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES (hide modal)
   ============================================ */

@media print {
    .callback-modal-overlay,
    .after-hours-sticky {
        display: none !important;
    }
}
