/**
 * Site Layout Master CSS
 * Layout styles for the main site interface
 */

.site-module {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Open Sans', sans-serif;
}

/* ================== MODERN NAVIGATION ================== */
.site-navbar {
    background: rgba(102, 126, 234, 1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* GPU Acceleration for smooth scrolling - usando will-change ao invés de transform */
    will-change: background;
    backface-visibility: hidden;
    /* Smooth transition for opacity changes only */
    transition: background 0.2s ease-in-out;
}

.site-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.site-brand:hover {
    color: #f0f0f0;
    text-decoration: none;
}

.site-nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-nav-link:hover {
    color: #ffffff;
    text-decoration: none;
}

.site-nav-link.active {
    color: #ffffff;
}

/* ================== USER DROPDOWN ================== */
.user-dropdown {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Custom dropdown toggle arrow */
.dropdown-toggle::after {
    color: rgba(255, 255, 255, 0.9) !important;
    border-top-color: rgba(255, 255, 255, 0.9) !important;
}

.dropdown-toggle:hover::after {
    color: #ffffff !important;
    border-top-color: #ffffff !important;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    min-width: 250px;
    padding: 0.5rem 0;
}

.user-dropdown-menu .dropdown-header {
    padding: 1rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    margin: 0 0.5rem;
    border-radius: 10px;
    border: none;
}

.user-dropdown-menu .dropdown-item {
    padding: 0.7rem 1.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border-radius: 8px;
    margin: 0.2rem 0.5rem;
}

.user-dropdown-menu .dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

.user-dropdown-menu .dropdown-divider {
    margin: 0.5rem 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* ================== ALL DROPDOWN MENUS ================== */
/* Estilo compacto e elegante para todos os dropdowns */
.site-navbar .dropdown-menu,
.site-footer .dropdown-menu {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    min-width: 200px;
    margin-top: 0.3rem;
}

.site-navbar .dropdown-menu .dropdown-item,
.site-footer .dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.95);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    font-size: 0.95rem;
}

.site-navbar .dropdown-menu .dropdown-item:last-child,
.site-footer .dropdown-menu .dropdown-item:last-child {
    margin-bottom: 0;
}

.site-navbar .dropdown-menu .dropdown-item:hover,
.site-footer .dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateX(3px);
}

.site-navbar .dropdown-menu .dropdown-item.active,
.site-footer .dropdown-menu .dropdown-item.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
}

.site-navbar .dropdown-menu .dropdown-item.disabled,
.site-navbar .dropdown-menu .dropdown-item.text-muted,
.site-footer .dropdown-menu .dropdown-item.disabled,
.site-footer .dropdown-menu .dropdown-item.text-muted {
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

.site-navbar .dropdown-menu .dropdown-item.disabled:hover,
.site-navbar .dropdown-menu .dropdown-item.text-muted:hover,
.site-footer .dropdown-menu .dropdown-item.disabled:hover,
.site-footer .dropdown-menu .dropdown-item.text-muted:hover {
    background: transparent;
    transform: none;
}

.site-navbar .dropdown-menu .dropdown-divider,
.site-footer .dropdown-menu .dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
}

/* User dropdown específico */
.user-dropdown-menu {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
    min-width: 260px !important;
    padding: 0.5rem !important;
}

.user-dropdown-menu .dropdown-header {
    padding: 1rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem !important;
    color: #ffffff !important;
}

.user-dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 0.7rem 1rem !important;
    border-radius: 6px !important;
    margin-bottom: 0.25rem !important;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}

.user-dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    transform: translateX(3px) !important;
}

.user-dropdown-menu .dropdown-item.text-danger {
    color: #ffcccc !important;
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.3) !important;
    color: #ffffff !important;
}

.user-dropdown-menu .dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    margin: 0.5rem 0 !important;
}

/* Footer dropdowns abrem para cima */
.site-footer .dropup .dropdown-menu {
    bottom: 100%;
    top: auto;
    margin-bottom: 0.3rem;
}

/* ================== CONTENT AREA ================== */
.site-content {
    padding: 2rem 0;
}

/* ================== MOBILE RESPONSIVENESS ================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Logo responsivo */
.site-logo {
    height: 70px;
    vertical-align: middle;
    transition: height 0.3s ease;
}

@media (max-width: 768px) {
    /* Logo menor em mobile */
    .site-logo {
        height: 50px;
        position: relative;
        margin-top: 0;
    }
    
    .site-brand {
        position: relative;
    }
    
    /* Menu mobile - escondido por padrão */
    .site-nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(31, 41, 55, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        align-items: center;
    }
    
    /* Menu mobile ativo */
    .site-nav-menu.mobile-active {
        transform: translateX(0);
    }
    
    /* Links do menu em mobile */
    .site-nav-menu > a,
    .site-nav-menu > .dropdown {
        width: 100%;
        max-width: 400px;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .site-nav-link {
        width: 100%;
        padding: 15px 20px;
        justify-content: center;
        font-size: 16px;
        color: rgba(255, 255, 255, 0.9);
        background: transparent;
    }
    
    .site-nav-link:hover {
        color: #ffffff;
    }
    
    .site-nav-link.active {
        color: #ffffff;
    }
    
    .site-nav-link span {
        margin-left: 10px;
    }
    
    /* Dropdowns em mobile */
    .site-nav-menu .dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .site-nav-menu .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        margin-top: 5px;
        background: transparent;
        border: none;
    }
    
    .site-nav-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 12px 20px;
        background: transparent;
        text-align: center;
        border-radius: 25px;
    }
    
    .site-nav-menu .dropdown-item:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .site-nav-menu .dropdown-item.active {
        background: rgba(255, 255, 255, 0.25);
        color: #ffffff;
    }
    
    .site-nav-menu .dropdown-item.disabled {
        color: rgba(255, 255, 255, 0.5);
    }
    
    /* User avatar dropdown em mobile - centralizado */
    .site-nav-menu > .dropdown:last-child {
        display: flex;
        justify-content: center;
    }
    
    .site-nav-menu .dropdown-toggle {
        margin: 0 auto;
    }
    
    /* User avatar em mobile */
    .user-avatar {
        width: 35px;
        height: 35px;
    }
    
    /* Container do navbar */
    .site-navbar .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Esconder textos em telas muito pequenas */
    @media (max-width: 576px) {
        .site-nav-link span {
            display: inline;
        }
    }
}

@media (min-width: 769px) {
    /* Esconder botão hamburger em desktop */
    .mobile-menu-toggle {
        display: none;
    }
    
    /* Logo em desktop */
    .site-logo {
        position: fixed;
        margin-top: -36px;
    }
}

@media (max-width: 768px) {
    .site-nav-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-navbar .container {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ================== THEME VARIATIONS ================== */

/* Default Theme - Purple Galaxy */
.theme-purple-galaxy {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    --theme-gradient-start: #5a67d8;
    --theme-gradient-end: #6b46c1;
}

/* Blue Ocean Theme */
.theme-blue-ocean {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    --theme-gradient-start: #3182ce;
    --theme-gradient-end: #2c5282;
}

/* Green Forest Theme */
.theme-green-forest {
    background: linear-gradient(135deg, #2d5016 0%, #1e3a0f 100%);
    --theme-gradient-start: #2d5016;
    --theme-gradient-end: #1e3a0f;
}

/* Pink Sunset Theme */
.theme-pink-sunset {
    background: linear-gradient(135deg, #8b1e3f 0%, #5c1028 100%);
    --theme-gradient-start: #8b1e3f;
    --theme-gradient-end: #5c1028;
}

/* Dark Mode Theme */
.theme-dark-mode {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --theme-gradient-start: #2c3e50;
    --theme-gradient-end: #34495e;
}

.theme-dark-mode .site-navbar {
    background: rgba(0, 0, 0, 0.3);
}

.theme-dark-mode .content-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ================== PREDEFINED AVATARS ================== */
.predefined-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.predefined-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.predefined-avatar i {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ================== FOOTER STYLES ================== */
.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 2rem 0 1.5rem 0;
}

.footer-bottom {
    padding-top: 0.5rem;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 767px) {
    .footer-copyright {
        font-size: 0.85rem;
    }
}
