/* css/style.css - CORREÇÃO MOBILE DEFINITIVA */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* --- CORES --- */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-input: #f1f5f9;
    
    --border: #e2e8f0;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    
    --text-main: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --radius: 12px;
    --sidebar-width: 260px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    font-size: 15px;
    overflow-x: hidden; /* Impede rolagem lateral indesejada */
}

/* Garante que o corpo só apareça quando carregado */
body.loaded { opacity: 1; }

h1, h2, h3, button, .brand { font-family: 'Plus Jakarta Sans', sans-serif; }
a { text-decoration: none; color: inherit; transition: 0.2s; }

/* --- COMPONENTES --- */
.btn-primary {
    background: var(--primary); color: white; border: none;
    padding: 12px 24px; border-radius: 8px; font-weight: 600;
    cursor: pointer; box-shadow: var(--shadow-sm); transition: 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-ghost {
    background: white; border: 1px solid var(--border);
    color: var(--text-main); padding: 10px 20px; border-radius: 8px;
    font-weight: 600; cursor: pointer; transition: 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-ghost:hover { background: var(--bg-input); border-color: var(--text-secondary); }

/* --- LAYOUT PRINCIPAL --- */
.app-layout { 
    display: flex; 
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* HEADER MOBILE (Barra superior no celular) */
.mobile-header {
    display: none; /* Invisível no PC */
    background: var(--bg-surface);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    position: fixed; /* Fixo no topo */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Z-index alto para ficar acima de tudo */
    height: 60px;
}

/* SIDEBAR (Barra Lateral) */
.sidebar {
    width: var(--sidebar-width); 
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 24px;
    position: fixed; 
    height: 100vh; 
    z-index: 1100; /* Acima do header mobile */
    overflow-y: auto;
    top: 0;
    left: 0;
    transition: transform 0.3s ease; /* Animação suave */
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(138, 138, 138, 0.4); border-radius: 10px; }

/* CONTEÚDO PRINCIPAL */
.main-content { 
    margin-left: var(--sidebar-width); /* Empurra conteúdo pra direita no PC */
    flex: 1; 
    padding: 40px; 
    width: 100%; 
    transition: margin 0.3s ease;
}

/* --- ELEMENTOS DA SIDEBAR --- */
.brand {
    font-size: 1.5rem; font-weight: 800; color: var(--primary);
    margin-bottom: 40px; display: flex; align-items: center; gap: 8px;
}
.brand span { color: var(--text-main); font-weight: 600; }

.nav-item {
    padding: 12px 16px; margin-bottom: 4px; border-radius: 8px;
    color: var(--text-secondary); font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: all 0.2s;
}
.nav-item:hover { background: var(--bg-input); color: var(--text-main); }
.nav-item.active { background: rgba(99, 102, 241, 0.1); color: var(--primary); font-weight: 600; }

/* Botão do Menu Hambúrguer */
.menu-toggle {
    background: transparent; border: none; font-size: 1.5rem;
    color: var(--text-main); cursor: pointer; padding: 5px;
}

/* --- CARDS & GRID --- */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 24px; 
}

.card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: 0.3s ease; display: flex; flex-direction: column;
    box-shadow: var(--shadow-sm); height: 100%; position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.card-banner { height: 120px; width: 100%; object-fit: cover; background: #e2e8f0; }
.card-body { padding: 20px; margin-top: -35px; position: relative; flex: 1; display: flex; flex-direction: column; }
.card-icon {
    width: 64px; height: 64px; border-radius: 14px;
    background: #fff; border: 4px solid var(--bg-surface);
    box-shadow: var(--shadow-md); object-fit: cover; margin-bottom: 12px;
}
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
.card-cat {
    display: inline-block; font-size: 0.75rem; color: var(--primary);
    background: rgba(99, 102, 241, 0.1); padding: 2px 8px; border-radius: 4px;
    font-weight: 600; margin-bottom: 10px;
}
.card-desc {
    color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 20px;
}
.card-btn {
    margin-top: auto; width: 100%; padding: 10px; border-radius: 6px;
    background: white; border: 1px solid var(--border);
    text-align: center; font-weight: 600; color: var(--text-secondary);
    transition: 0.2s;
}
.card-btn:hover { border-color: var(--primary); color: var(--primary); background: #fefeff; }

/* --- FORMS & LOGIN --- */
.form-box { background: var(--bg-surface); padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); }
.form-input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-input); font-family: inherit; margin-bottom: 10px; }
.auth-wrapper {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background-color: var(--bg-body);
    padding: 20px;
}
.auth-box {
    width: 100%; max-width: 420px; padding: 40px;
    background: var(--bg-surface); border-radius: 16px;
    border: 1px solid var(--border); box-shadow: var(--shadow-lg); text-align: center;
}
.page-header { margin-bottom: 30px; }

/* --- OVERLAY DO MENU --- */
.menu-overlay {
    display: none; 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1050; backdrop-filter: blur(2px);
}
.menu-overlay.active { display: block; }

/* Classe para seus Emojis Personalizados */
.custom-icon {
    width: 20px; height: 20px; object-fit: contain; display: block;
}
.nav-item.active .custom-icon {
    filter: drop-shadow(0 0 2px rgba(99, 102, 241, 0.5));
}

/* ==========================================================================
   CORREÇÕES CRÍTICAS DE RESPONSIVIDADE
   ========================================================================== */

/* MODO COMPUTADOR (Telas maiores que 901px) */
@media (min-width: 901px) {
    .menu-overlay, .menu-overlay.active { display: none !important; opacity: 0 !important; pointer-events: none !important; }
    .sidebar { transform: translateX(0) !important; display: flex !important; }
    .mobile-header { display: none !important; }
}

/* MODO CELULAR / TABLET (Telas menores que 900px) */
@media (max-width: 900px) {
    /* 1. Header e Sidebar */
    .mobile-header { display: flex; }
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: 2px 0 10px rgba(0,0,0,0.1); }
    .sidebar.active { transform: translateX(0); }

    /* 2. Conteúdo Principal */
    .main-content { 
        margin-left: 0 !important; 
        padding: 20px; 
        padding-top: 80px; /* Importante para o header não cobrir */
        width: 100%;
    }
    
    /* 3. Grid geral (Cards) em 1 coluna */
    .grid { grid-template-columns: 1fr; }
    
    /* 4. AJUSTE: Inputs de busca não estourarem a tela */
    .form-box { flex-direction: column; align-items: stretch; gap: 15px; }
    .form-box .btn-primary { width: 100%; }
    
    /* 5. AJUSTE: Página de Adicionar Servidor / Dashboard */
    /* Força os grids de formulário a ficarem um embaixo do outro */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* 6. AJUSTE: Página do Servidor (Server.html) */
    .server-container {
        grid-template-columns: 1fr !important;
        padding: 0 15px !important;
    }
    .server-sidebar {
        margin-top: -50px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .server-logo {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* Ajustes menores */
    .sidebar .brand { margin-bottom: 20px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
/* --- BOTÃO DISCORD --- */
.btn-discord {
    background-color: #5865F2; /* Cor Oficial Discord */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: 0.2s;
    margin-bottom: 20px;
    font-size: 1rem;
    box-shadow: 0 4px 0 #4752c4; /* Efeito 3D sutil */
}

.btn-discord:hover {
    background-color: #4752c4;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #4752c4;
}

.btn-discord:active {
    transform: translateY(4px);
    box-shadow: none;
}
/* --- INPUT SWITCHER (LINK / UPLOAD) --- */
.input-group-container {
    margin-bottom: 15px;
}

.switcher-box {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.switch-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.switch-btn:hover {
    color: var(--text-main);
}

.switch-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
/* --- BOTÃO DE BUMP --- */
.btn-bump {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-bump:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.6);
}

.btn-bump:active {
    transform: scale(0.95);
}

.btn-bump.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
/* Botão Discord (Estilo Login e Convite) */
.btn-discord {
    background-color: #5865F2; /* Cor Oficial */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%; /* No HTML acima forçamos 'auto' para não esticar */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: 0.2s;
    font-size: 1rem;
    box-shadow: 0 4px 0 #4752c4;
}

.btn-discord:hover {
    background-color: #4752c4;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #4752c4;
}

.btn-discord:active {
    transform: translateY(4px);
    box-shadow: none;
}