/* css/global.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Cores do Tema */
    --bg-dark: #121214;
    --bg-card: #1E1E24;
    --brand-pink: #FF4081; /* Padrão, mas o JS vai mudar */
    --brand-pink-hover: #D81B60;
    
    /* Textos */
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    
    /* Cores de Status */
    --green: #00E676;
    --red: #FF1744;
    --purple: #651FFF;
    --blue: #2979FF;
    
    /* Tamanhos */
    --sidebar-width: 250px;
    --mobile-nav-height: 70px;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar personalizada (estilo dark) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* --- Efeitos de Animação e Brilho --- */
@keyframes textShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Texto do rodapé com a cor do tema */
.user-profile p {
    background: linear-gradient(
        90deg, 
        #A1A1AA, 
        var(--brand-pink), 
        #FFFFFF, 
        var(--brand-pink), 
        #A1A1AA
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    animation: textShine 4s ease-in-out infinite;
}

.user-profile small {
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* --- Cards Tecnológicos --- */
.tech-card {
    background: rgba(30, 30, 36, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        color-mix(in srgb, var(--brand-pink) 10%, transparent), 
        transparent
    );
    transition: 0.5s;
}

.tech-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--brand-pink) 40%, transparent);
    box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--brand-pink) 30%, transparent);
}

.tech-card:hover::before {
    left: 100%;
}

/* =========================================
   SISTEMA DE AVISOS (TOAST)
========================================= */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #1E1E24;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--brand-pink);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success { border-color: #00E676; }
.toast.error { border-color: #FF1744; }


/* =========================================
   ESTILOS DO MENU MOBILE (A CAIXINHA)
========================================= */

/* Esconde no Desktop por padrão */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block; 
}

/* Botão Redondo com Ícone */
.user-menu-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.user-menu-btn:focus { outline: none; }
.user-menu-btn:hover { background: rgba(255,255,255,0.1); }

/* A Caixinha Suspensa (Dropdown) */
.mobile-dropdown {
    position: absolute;
    background: #1E1E24;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px 0;
    width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    animation: fadeInDown 0.2s ease forwards;
    z-index: 2000;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-dropdown.hidden {
    display: none;
}

.dropdown-header {
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 8px;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
}

.dropdown-item span {
    font-size: 18px;
}

/* =========================================
   MEDIA QUERIES (RESPONSIVIDADE GERAL)
========================================= */
@media (max-width: 768px) {
    
    /* Inverte quem aparece e quem some */
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* Ajuste do cabeçalho das páginas */
    header.page-header, header.dash-header {
        display: flex;
        flex-direction: column; /* Deixa o título em cima e a data em baixo */
        align-items: flex-start; 
        position: relative; /* Transforma o header na "âncora" do menu */
        padding-right: 70px !important; /* Espaço pro ícone não amassar o texto */
    }

    /* Ajuste na largura dos textos do cabeçalho */
    .header-text, header.dash-header > div:first-child {
        width: 100%;
        margin-bottom: 12px;
    }

    /* POSICIONAMENTO MÁGICO DO ÍCONE */
    .mobile-user-menu {
        position: absolute !important;
        top: 24px;  /* Distância do topo da tela */
        right: 24px; /* Distância do canto direito da tela */
        margin: 0 !important;
    }

    /* Posiciona a caixinha abaixo do ícone */
    .mobile-dropdown {
        right: 0;
        top: 50px; 
    }
    
    /* Espaçamento extra pra botões do topo */
    header.page-header > button,
    header.dash-header .date-badge {
        margin-top: 4px;
        align-self: flex-start; 
    }
}


/* Overlay do Loader Global */
#global-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(18, 18, 20, 0.9); /* Fundo dark idêntico ao site */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

/* Spinner Tecnológico */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 64, 129, 0.1);
    border-top: 3px solid var(--brand-pink);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 0 15px color-mix(in srgb, var(--brand-pink) 30%, transparent);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 16px;
    color: var(--brand-pink);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Classe para esconder com suavidade */
.loader-hidden {
    opacity: 0;
    pointer-events: none;
}