/* File: css/mobile-barber-modal.css - Mobile Barber Modal Styles */
/* Handles all styling for the mobile "View Barber" modal and related components */

/* Mobile Barber Modal Styles */
/* ========================== */

/* Mobile View Barber Button Container */
.mobile-view-barber-container {
    display: none; /* Hidden by default, shown via media query */
    position: fixed;
    top: 50%; /* Center vertically */
    left: 0;
    height: 100vh;
    width: 50px; /* Fixed width for the vertical container */
    z-index: 999;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Allow clicks to pass through container */
    transform: translateY(-50%); /* Proper vertical centering */
}

/* Mobile View Barber Button */
.mobile-view-barber-btn {
    background: linear-gradient(135deg, #6a00bf, #8e44ad);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 20px 12px; /* Adjusted for vertical text */
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(106, 0, 191, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 100px; /* Adequate height for vertical text */
    width: 40px; /* Fixed width */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    writing-mode: vertical-rl; /* Vertical text */
    pointer-events: auto; /* Re-enable clicks for the button */
    transform: translateY(0);
}

/* Hidden state during scroll */
.mobile-view-barber-btn.scroll-hidden {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

/* Modal overlay */
.mobile-barber-modal {
    display: none; /* Toggled via JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    overflow-y: auto;
}

/* Modal content */
.mobile-barber-modal-content {
    background: #121420; /* Low-glare dark background */
    color: #e8eaf0;      /* High-contrast text */
    margin: 60px auto 20px;
    padding: 0;
    width: 95%;
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: modalSlideIn 0.3s ease-out;
}

/* Modal header */
.mobile-barber-modal-header {
    background: linear-gradient(135deg, #6a00bf, #8e44ad);
    color: #ffffff;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-barber-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-modal-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-modal-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Modal grid */
.mobile-barber-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

/* Barber Card */
.mobile-barber-card {
    background: #1c2130; /* Dark card */
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
    color: #e3e7ef;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-barber-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
    background: linear-gradient(135deg, #1c2130, #23293a);
}

.mobile-barber-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid #7a47ff; /* Slightly brighter ring for contrast */
    background: #0f111a;
}

.mobile-barber-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #f0f3f7;
}

.mobile-barber-card .book-btn {
    background: linear-gradient(135deg, #6a00bf, #8e44ad);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 0.2px;
}

.mobile-barber-card .book-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    transform: translateY(-1px);
}

/* Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Hide mobile view barber button on specific page sections */
/* ======================================================= */

/* JavaScript-controlled hiding using body classes */
body.hide-mobile-barber-btn .mobile-view-barber-container {
    display: none !important;
}

/* Hide when specific sections are active (JavaScript will add these classes to body) */
body.section-requestCancellation .mobile-view-barber-container,
body.section-manager .mobile-view-barber-container,
body.section-about .mobile-view-barber-container,
body.section-contact-us .mobile-view-barber-container,
body.section-terms .mobile-view-barber-container,
body.section-privacy .mobile-view-barber-container {
    display: none !important;
}

/* Alternative: Hide using data attributes on the button container */
.mobile-view-barber-container[data-hidden="true"],
.mobile-view-barber-container[data-hide-on-section] {
    display: none !important;
}

/* Alternative: Direct section-based hiding (fallback) */
.mobile-view-barber-container.hidden-on-section {
    display: none !important;
}

/* Responsive Design */
/* ================= */

/* Show only on small devices (but respect section-specific hiding rules) */
@media (max-width: 768px) {
    .mobile-view-barber-container {
        display: flex;
    }

    /* Ensure hiding rules still work within mobile breakpoint */
    body.hide-mobile-barber-btn .mobile-view-barber-container,
    body.section-requestCancellation .mobile-view-barber-container,
    body.section-manager .mobile-view-barber-container,
    body.section-about .mobile-view-barber-container,
    body.section-contact-us .mobile-view-barber-container,
    body.section-terms .mobile-view-barber-container,
    body.section-privacy .mobile-view-barber-container,
    .mobile-view-barber-container[data-hidden="true"],
    .mobile-view-barber-container[data-hide-on-section],
    .mobile-view-barber-container.hidden-on-section {
        display: none !important;
    }
}

/* Adjust for very small screens */
@media (max-width: 480px) {
    .mobile-barber-modal-content {
        width: 98%;
        margin: 40px auto 10px;
    }

    .mobile-barber-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
        padding: 15px;
    }

    .mobile-barber-card {
        padding: 12px;
    }

    .mobile-barber-card img {
        width: 60px;
        height: 60px;
    }

    .mobile-view-barber-container {
        width: 50px; /* Smaller container on very small screens */
    }

    .mobile-view-barber-btn {
        padding: 16px 10px;
        font-size: 13px;
        min-height: 120px;
        width: 40px;
    }
}

/* Additional Utility Classes */
/* ========================== */

/* Loading state for modal */
.mobile-barber-modal.loading .mobile-barber-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Error state for modal */
.mobile-barber-modal.error .mobile-barber-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #dc3545;
}

/* Button processing state */
.mobile-barber-card .book-btn.processing {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.mobile-barber-card .book-btn.processing:hover {
    transform: none !important;
}

/* Utility class to hide button programmatically */
.mobile-view-barber-container.hidden,
.mobile-view-barber-container.hide-button {
    display: none !important;
}

/* Show button explicitly (can override hide rules if needed) */
.mobile-view-barber-container.show-button {
    display: flex !important;
}

/* Hide button on specific page contexts */
.page-requestCancellation .mobile-view-barber-container,
.page-manager .mobile-view-barber-container,
.page-about .mobile-view-barber-container,
.page-contact-us .mobile-view-barber-container,
.page-terms .mobile-view-barber-container,
.page-privacy .mobile-view-barber-container {
    display: none !important;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .mobile-barber-modal-content {
        animation: none;
    }

    .mobile-barber-card,
    .mobile-view-barber-btn,
    .close-modal-btn,
    .mobile-barber-card .book-btn {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mobile-view-barber-btn {
        border: 2px solid #ffffff;
    }

    .mobile-barber-card {
        border: 1px solid #333333;
    }

    .mobile-barber-card .book-btn {
        border: 1px solid #ffffff;
    }
}

/* Focus states for accessibility */
.mobile-view-barber-btn:focus,
.close-modal-btn:focus,
.mobile-barber-card .book-btn:focus {
    outline: 2px solid #6a00bf;
    outline-offset: 2px;
}

/* Print styles (hide modal completely) */
@media print {
    .mobile-view-barber-container,
    .mobile-barber-modal {
        display: none !important;
    }
}