/* 
   PORTAL FANTASY - DESIGN SYSTEM 
   Theme: Dark Premium & Modern
*/

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

:root {
    /* Color Palette - Dark Premium */
    --bg-body: #0f172a;
    /* Slate 900 - Fundo principal */
    --bg-card: #1e293b;
    /* Slate 800 - Cards */
    --bg-input: #334155;
    /* Slate 700 */

    --primary: #6366f1;
    /* Indigo 500 - Cor Principal */
    --primary-hover: #4f46e5;

    --secondary: #ec4899;
    /* Pink 500 - Destaques/Ações */
    --accent: #eab308;
    /* Yellow 500 - Alertas/Gold */

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --success: #10b981;
    --danger: #ef4444;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.3);

    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;

    --font-main: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.1);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Utility Classes */
.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Card Component */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Auth Page Specifics */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e1b4b 0%, var(--bg-body) 40%);
}

.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-text {
    font-size: 1.8rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* --- ADMIN PANEL STYLES --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h3 {
    font-size: 1.5rem;
    color: white;
}

.badge-admin {
    background-color: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 1rem;
    flex-grow: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    margin-bottom: 5px;
    gap: 12px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background-color: var(--bg-body);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.content-wrapper {
    padding: 2rem;
    flex-grow: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.stat-info h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-info .number {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-aguardando {
    background: rgba(234, 179, 8, 0.2);
    color: var(--accent);
}

.status-ativo {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-bloqueado {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- EMPLOYEE NAVBAR --- */
.employee-navbar {
    background: var(--bg-card);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Reduced gap for mobile/tablet */
    color: var(--primary);
    font-weight: 700;
    font-size: 1.15rem;
    /* Slightly smaller to fit */
    flex-shrink: 0;
}

.nav-search-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
    /* Push to right side */
    margin-right: 15px;
}

/* Hide search bar on tablets/small laptops to avoid overlap with central menu */
@media (max-width: 1100px) {
    .nav-search-wrapper {
        display: none;
    }
}

.nav-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 6px 16px;
    width: 100%;
    max-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-search input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    padding: 4px;
    outline: none;
}

.nav-search button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-size: 0.95rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 0.8;
}

/* --- NAV MENU (BARRA DE NAVEGAÇÃO) --- */
.nav-menu {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 10000;
    transition: all 0.3s ease;
}

/* Hide text labels on small desktops to keep it compact */
@media (max-width: 1200px) {
    .nav-menu span:not(.material-icons) {
        display: none;
    }

    .nav-menu {
        gap: 1.5rem;
    }
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
}

.nav-link.active,
.nav-link:hover {
    color: var(--primary);
}

/* --- MOBILE RESPONSIVENESS (APP STYLE) --- */
@media (max-width: 768px) {
    .nav-search-wrapper {
        display: none;
    }

    /* Barra Inferior Fixa para Mobile */
    .nav-menu {
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        background: #111827 !important;
        /* Cor sólida profunda */
        display: flex !important;
        justify-content: space-around !important;
        padding: 12px 0 30px 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
        z-index: 999999 !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5) !important;
    }

    .nav-link {
        flex-direction: column;
        gap: 5px;
        font-size: 0.7rem;
        padding: 0;
        min-width: 80px;
        text-align: center;
        color: #94a3b8;
    }

    .nav-link span:not(.material-icons) {
        display: block !important;
        font-size: 0.65rem;
        opacity: 0.9;
    }

    .nav-link .material-icons {
        font-size: 26px;
    }

    .nav-link.active {
        color: #6366f1 !important;
    }

    /* Esconde spans de texto específicos no topo se necessário */
    .nav-user .btn-logout span:not(.material-icons) {
        display: none;
    }

    .nav-brand span {
        font-size: 1rem;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .container {
        padding: 0 1.25rem;
    }

    .employee-main {
        padding-bottom: 110px;
        /* Space for the bottom menu */
        padding-top: 20px;
    }

    .forum-header {
        padding: 25px;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .forum-header .btn {
        width: 100%;
    }

    .nav-brand span {
        font-size: 1rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    /* Admin Sidebar Adapt */
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }
}