/* Navigation Component Styles
 * Stili per navbar mobile e desktop
 */

/* ==================== MOBILE NAVBAR STYLES ==================== */
#mobile_navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #111;
    display: block;
}

/* Nasconde mobile navbar su desktop */
@media (min-width: 992px) {
    #mobile_navbar {
        display: none !important;
    }
}

.mobile-navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    letter-spacing: 1px;
}

.mobile-logo:hover {
    color: #fff !important;
    text-decoration: none !important;
}

/* Menu dropdown container - subito a destra del logo */
.mobile-navbar-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
    margin-left: 16px;
}

.mobile-navbar-menu .dropdown {
    position: relative;
}

.mobile-photo-category-btn {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    padding: 6px 28px 6px 12px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.mobile-photo-category-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mobile-photo-category-btn:hover,
.mobile-photo-category-btn:focus,
.mobile-photo-category-btn:active,
.mobile-photo-category-btn.show {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

.mobile-photo-category-btn::after {
    margin-left: 0 !important;
    border-top-color: #fff !important;
    border-width: 0.4em 0.35em 0 !important;
}

.mobile-photo-category-menu {
    background-color: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    min-width: 200px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    margin-top: 8px !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    z-index: 1050 !important;
    transform: none !important;
}

.mobile-photo-category-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 10px 16px !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
}

.mobile-photo-category-menu .dropdown-item:hover,
.mobile-photo-category-menu .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.mobile-photo-category-menu .dropdown-item.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.mobile-photo-category-menu .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
    margin: 6px 0 !important;
}

/* Pulsante Modelle (icona viso donna) */
.mobile-models-link {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.mobile-models-link:hover {
    opacity: 0.7;
    color: #fff;
    text-decoration: none;
}

.mobile-models-link svg {
    width: 20px;
    height: 20px;
}

/* Pulsante Fotografi (icona fotocamera) */
.mobile-photographers-link {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.mobile-photographers-link:hover {
    opacity: 0.7;
    color: #fff;
    text-decoration: none;
}

.mobile-photographers-link svg {
    width: 20px;
    height: 20px;
}

/* Pulsante Agenzie (icona edificio) */
.mobile-agencies-link {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.mobile-agencies-link:hover {
    opacity: 0.7;
    color: #fff;
    text-decoration: none;
}

.mobile-agencies-link svg {
    width: 20px;
    height: 20px;
}

/* Pulsante toggle ricerca */
.mobile-search-toggle {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.mobile-search-toggle:hover {
    opacity: 0.7;
}

.mobile-search-toggle svg {
    width: 20px;
    height: 20px;
}

/* Container ricerca a scomparsa - sotto l'header */
.mobile-search-container {
    width: 100%;
    padding: 12px 16px;
    background: #111;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideDown 0.3s ease;
}

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

.mobile-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    flex: 1;
}

.mobile-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.875rem;
    padding: 0;
    outline: none;
}

.mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.mobile-search-submit {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.mobile-search-submit:hover {
    opacity: 0.7;
}

.mobile-search-submit svg {
    width: 18px;
    height: 18px;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* NSFW Toggle dentro il container ricerca - sulla stessa riga del form */
.mobile-search-container .mobile-nsfw-toggle {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    color: #fff;
    flex-shrink: 0;
}

.mobile-search-container .mobile-nsfw-toggle:hover {
    opacity: 0.7;
}

.mobile-search-container .mobile-nsfw-toggle svg {
    width: 22px;
    height: 22px;
}

/* Right side container for mobile navbar */
.mobile-navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile NSFW Toggle Button */
.mobile-nsfw-toggle {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
}

.mobile-nsfw-toggle:hover {
    color: #fff;
}

/* Eye icons visibility */
.mobile-nsfw-toggle .eye-open {
    display: none;
}

.mobile-nsfw-toggle .eye-closed {
    display: block;
}

/* Quando NSFW è abilitato: mostra occhio aperto */
body.nsfw-enabled .mobile-nsfw-toggle .eye-open {
    display: block;
}

body.nsfw-enabled .mobile-nsfw-toggle .eye-closed {
    display: none;
}

/* Colore rosso quando NSFW è attivo */
body.nsfw-enabled .mobile-nsfw-toggle {
    color: #dc3545 !important;
}

body.nsfw-enabled .mobile-nsfw-toggle svg {
    fill: #dc3545 !important;
    color: #dc3545 !important;
}

.mobile-hamburger {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

/* Hamburger animazione quando aperto */
.mobile-hamburger.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-hamburger.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Menu dropdown mobile */
.mobile-menu {
    display: none;
    background: #111 !important;
    background-color: #111 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu.open {
    display: block !important;
}

.mobile-menu-item {
    display: block !important;
    padding: 16px 20px !important;
    color: #fff !important;
    background: #111 !important;
    background-color: #111 !important;
    text-decoration: none !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus,
.mobile-menu-item:active,
.mobile-menu-item.active {
    color: #fff !important;
    background: #222 !important;
    background-color: #222 !important;
    text-decoration: none !important;
}

.mobile-menu-item:last-child {
    border-bottom: none !important;
}

/* Body padding per mobile navbar */
@media (max-width: 991.98px) {
    body {
        padding-top: 56px !important;
    }
}

/* Nasconde desktop navbar su mobile */
@media (max-width: 991.98px) {
    #navbar_main {
        display: none !important;
    }
}

/* ==================== DESKTOP NAVBAR STYLES ==================== */
#navbar_main {
    background: #111 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
}

#navbar_main .navbar-brand img {
    height: 16px;
    width: auto;
}

#navbar_main .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

#navbar_main .nav-link:hover,
#navbar_main .nav-link.active {
    color: #fff !important;
}

#navbar_main .dropdown {
    position: relative;
}

#navbar_main .dropdown-menu {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 10rem;
    /* Forza apertura verso il basso */
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    left: 0 !important;
    transform: none !important;
    margin-top: 0 !important;
}

#navbar_main .dropdown-menu.show {
    display: block;
}

#navbar_main .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 1rem;
}

#navbar_main .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#navbar_main .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Search bar */
.navbar-search-form {
    width: 100%;
    max-width: 320px;
}

.navbar-search-form .input-group-text {
    border-right: 0;
}

.navbar-search-form .form-control {
    border-left: 0;
}

.navbar-search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.navbar-search-form .form-control:focus {
    box-shadow: none;
}

/* ==================== LANGUAGE SWITCHER STYLES ==================== */
/* Desktop Language Switcher */
.language-switcher-container {
    position: relative;
}

.language-switcher-container .language-switcher-buttons {
    display: flex;
    gap: 6px;
}

.language-switcher-container .language-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-switcher-container .language-btn:hover {
    text-decoration: none;
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.mobile-language-switcher .language-switcher-buttons {
    display: flex;
    gap: 4px;
}

.mobile-language-switcher .language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 32px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-language-switcher .language-btn:hover {
    text-decoration: none;
}

.mobile-language-switcher .flag-icon {
    width: 14px;
    height: 10px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Nascondi text nel mobile language switcher quando showText è false */
.mobile-language-switcher .language-btn span:not(.flag-icon) {
    display: none;
}

/* Stili per i pulsanti del language switcher (sovrascrivono le classi Tailwind) */
.language-switcher-container .language-btn,
.mobile-language-switcher .language-btn {
    color: rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 255, 255, 0.05);
}

.language-switcher-container .language-btn:hover,
.mobile-language-switcher .language-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Pulsante attivo */
.language-switcher-container .language-btn.bg-blue-600,
.mobile-language-switcher .language-btn.bg-blue-600 {
    color: #fff;
    background-color: #2563eb !important;
    border-color: #2563eb;
}

/* Language Select - Sostituisce i pulsanti */
.language-select {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    min-width: 60px;
    height: 32px;
    cursor: pointer;
}

.language-select:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.language-select:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

.language-select option {
    background-color: #1a1a1a;
    color: #fff;
}

/* Pulsante non attivo - usa bg-gray-100 come fallback ma con stili navbar scura */
.language-switcher-container .language-btn.bg-gray-100,
.mobile-language-switcher .language-btn.bg-gray-100 {
    color: rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.navbar-search-form .form-control:focus {
    box-shadow: none;
    border-color: #3b82f6;
}

.navbar-search-form .input-group-text,
.navbar-search-form .form-control {
    border-color: rgba(255, 255, 255, 0.2);
    border-radius: 0 !important;
}

.navbar-search-form .input-group {
    border-radius: 0 !important;
}

/* Icon buttons */
.navbar-icon-btn {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.4rem !important;
    border: none !important;
    background: transparent !important;
    transition: color 0.2s ease;
}

.navbar-icon-btn:hover {
    color: #fff !important;
}

.navbar-icon-btn svg {
    fill: currentColor;
}

/* Icon unread state - red color */
.navbar-icon-btn.icon-unread {
    color: #dc3545 !important;
}

.navbar-icon-btn.icon-unread:hover {
    color: #bb2d3b !important;
}

/* Notification/message items in modal */
.notification-item,
.message-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:hover,
.message-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.notification-item.unread,
.message-item.unread {
    background: #fff9e6;
}

/* Forza layout corretto del navbar Bootstrap */
@media (min-width: 992px) {
    #navbar_main #navbarMainContent {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* Menu links a sinistra - non si espande oltre il necessario */
    #navbar_main .navbar-nav.me-auto {
        flex: 0 0 auto !important;
        margin-right: auto !important;
    }

    /* Search bar al centro - spazio flessibile */
    #navbar_main .navbar-search-form {
        flex: 0 1 320px !important;
        max-width: 320px !important;
        margin: 0 2rem !important;
    }

    /* User actions/login COMPLETAMENTE a destra */
    #navbar_main .navbar-nav.ms-auto {
        flex: 0 0 auto !important;
        margin-left: auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
    }
}

/* NSFW Toggle Styles */
.nsfw-toggle-container {
    flex-shrink: 0;
}

/* Desktop NSFW Toggle Button (occhio) */
.desktop-nsfw-toggle {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
}

.desktop-nsfw-toggle:hover {
    color: #fff;
}

/* Eye icons visibility - Desktop */
.desktop-nsfw-toggle .eye-open {
    display: none;
}

.desktop-nsfw-toggle .eye-closed {
    display: block;
}

/* Quando NSFW è abilitato: mostra occhio aperto - Desktop */
body.nsfw-enabled .desktop-nsfw-toggle .eye-open {
    display: block;
}

body.nsfw-enabled .desktop-nsfw-toggle .eye-closed {
    display: none;
}

/* Colore rosso quando NSFW è attivo - Desktop */
body.nsfw-enabled .desktop-nsfw-toggle {
    color: #dc3545 !important;
}

body.nsfw-enabled .desktop-nsfw-toggle svg {
    fill: #dc3545 !important;
    color: #dc3545 !important;
}

/* Desktop only elements */
.nav-item-desktop-only {
    display: block;
}

@media (max-width: 991.98px) {
    .nav-item-desktop-only {
        display: none !important;
    }
}

/* User navbar avatar styles - Assicura che l'avatar sia sempre visibile */
#navbar_main .nav-link.dropdown-toggle .user-navbar-avatar,
#navbar_main .nav-link.dropdown-toggle img.rounded-circle {
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.1);
}

#navbar_main .nav-link.dropdown-toggle {
    padding: 0.25rem !important;
    display: flex !important;
    align-items: center !important;
}
