/* css/base.css */

/* Geral e Reset Básico */
:root {
    /* Cores do Tema Escuro (padrão) */
    --bg-primary: #121820;
    --bg-secondary: #1a232e;
    --bg-tertiary: #232f3e;
    --text-primary: #e0e6ec;
    --text-secondary: #aebacd;
    --text-tertiary: #8794a3;
    --border-color: #364a60;
    --accent-color: #00bcd4;
    --accent-color-dark: #0097a7;
    --button-primary-bg: #00bcd4;
    --button-primary-hover-bg: #0097a7;
    --button-secondary-bg: transparent;
    --button-secondary-hover-bg: #00bcd4;
    --status-success: #4CAF50;
    --status-error: #f44336;
    --status-info: #2196F3;
    --status-warning: #ffc107;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-color-dark: rgba(0, 0, 0, 0.5);
    --shadow-color-accent: rgba(0, 188, 212, 0.4);
    --code-bg: #0d131a;
    --input-bg: #1a232e;
    --input-border: #364a60;
}

/* Tema Claro */
body.theme-light {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #007bff;
    --accent-color-dark: #0056b3;
    --button-primary-bg: #007bff;
    --button-primary-hover-bg: #0056b3;
    --button-secondary-bg: transparent;
    --button-secondary-hover-bg: #007bff;
    --status-success: #28a745;
    --status-error: #dc3545;
    --status-info: #17a2b8;
    --status-warning: #ffc107;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-color-dark: rgba(0, 0, 0, 0.15);
    --shadow-color-accent: rgba(0, 123, 255, 0.2);
    --code-bg: #e2e6ea;
    --input-bg: #ffffff;
    --input-border: #ced4da;
}

html, body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.body-dashboard {
    display: flex;
    flex-direction: row;
}

body.body-login-register {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== ESTRUTURA PRINCIPAL (SIDEBAR, HEADER, MAIN CONTENT) ===== */

.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    box-shadow: 2px 0 5px var(--shadow-color);
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    height: 100vh;
    box-sizing: border-box;
    position: fixed;
    left: 0;
    top: 0;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    gap: 15px;
    padding: 20px 0;
}

.sidebar .logo,
.sidebar .theme-switcher {
    padding: 0 20px;
    flex-shrink: 0;
}

.sidebar .logo {
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .logo i {
    margin-right: 10px;
    color: var(--accent-color);
}

.sidebar nav {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav ul li {
    margin-bottom: 12px;
}

.sidebar nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar nav ul li a i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active,
.sidebar nav ul li a.dropdown-toggle.active {
    background-color: var(--accent-color);
    color: white;
}

.sidebar nav ul li a:hover i,
.sidebar nav ul li a.active i,
.sidebar nav ul li a.dropdown-toggle.active i {
    color: white;
}

.sidebar nav ul li ul {
    list-style: none;
    padding-left: 30px;
    margin-top: 5px;
    display: none;
}

.sidebar nav ul li ul.show {
    display: block;
}

/* Scrollbar da Sidebar */
.sidebar nav::-webkit-scrollbar { width: 8px; }
.sidebar nav::-webkit-scrollbar-track { background: transparent; }
.sidebar nav::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
}
.sidebar nav::-webkit-scrollbar-thumb:hover { background-color: var(--accent-color); }

.main-content {
    flex-grow: 1;
    padding: 30px;
    color: var(--text-primary);
    margin-left: 260px;
    transition: margin-left 0.3s ease-in-out;
}

.main-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.mobile-header {
    display: none;
    background-color: var(--bg-secondary);
    padding: 10px 15px;
    align-items: center;
    box-shadow: 0 2px 5px var(--shadow-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

.logo-mobile {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-left: 15px;
}

.logo-mobile i {
    color: var(--accent-color);
}

/* ===== ELEMENTOS COMUNS (Botões, Inputs, Mensagens) ===== */

/* Botões */
.btn-primary, .btn-submit, .btn-ofuscar, .btn-purchase-card, .btn-action, .btn-generate-key {
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    color: white !important;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: 200% auto;
    box-shadow: 0 4px 15px 0 rgba(0, 188, 212, 0.35);
    background-image: linear-gradient(to right, #00BCD4 0%, #007BFF 51%, #00BCD4 100%);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover, .btn-submit:hover, .btn-ofuscar:hover, .btn-purchase-card:hover, .btn-action:hover, .btn-generate-key:hover {
    background-position: right center;
    box-shadow: 0 6px 20px 0 rgba(0, 119, 255, 0.45);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-secondary {
    font-weight: 600;
    border: 2px solid var(--border-color);
    background-color: transparent;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    display: block;
    text-align: center;
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Formulários */
.form-section, .list-section, .config-section {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-section h2, .list-section h2, .config-section h2 {
    font-weight: 600;
    font-size: 22px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.form-section h2 i, .list-section h2 i, .config-section h2 i {
    color: var(--accent-color);
    margin-right: 12px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

textarea, input[type="text"], input[type="date"], input[type="email"], input[type="number"], input[type="password"], select {
    width: 100%;
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    font-size: 16px !important;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    outline: none;
}

textarea:focus, input:focus, select:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.25) !important;
    background-color: var(--bg-secondary) !important;
}

/* Mensagens de Status */
.status-message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 15px;
    border-left: 5px solid;
}
.status-message.sucesso { background-color: rgba(76, 175, 80, 0.1); border-color: #4CAF50; color: #4CAF50; }
.status-message.erro { background-color: rgba(244, 67, 54, 0.1); border-color: #f44336; color: #f44336; }
.status-message.info { background-color: rgba(33, 150, 243, 0.1); border-color: #2196F3; color: #2196F3; }

/* Modal */
.modal {
    display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0,0,0,0.8); justify-content: center; align-items: center;
}
.modal-content {
    background-color: var(--bg-secondary); margin: auto; padding: 25px; border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color-dark); width: 90%; max-width: 600px;
    position: relative; box-sizing: border-box;
}
.close-button {
    color: var(--text-tertiary); font-size: 30px; font-weight: bold; position: absolute;
    top: 10px; right: 15px; cursor: pointer; transition: color 0.3s ease;
}
.close-button:hover { color: var(--status-error); }

/* RESPONSIVIDADE */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding-top: 80px; }
    .mobile-header { display: flex; }
    .overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 999; }
    .overlay.show { display: block; }
}

@media (max-width: 768px) {
    .main-content { padding: 20px; padding-top: 70px; }
    .main-content h1 { font-size: 24px; }
    .form-section, .list-section, .config-section { padding: 20px; }
}

@media (max-width: 480px) {
    .main-content { padding: 15px; padding-top: 65px; }
    .main-content h1 { font-size: 20px; }
    .btn-primary, .btn-secondary { padding: 10px; font-size: 15px; }
}