/* 
 * Dados Moka Informações - Premium SaaS CSS
 * Light & Dark theme support, smooth animations and glassmorphism.
 */

:root {
    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;

    /* Theme Clean Light (Default) */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a; /* Sleek dark sidebar even in light mode for modern SaaS style */
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.08);
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #1d4ed8;
    --accent-color: #6366f1;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.04), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.03), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
}

[data-theme="dark"] {
    /* Theme Premium Dark */
    --bg-main: #0b0f19;
    --bg-card: #111827;
    --bg-sidebar: #0b0f19;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --sidebar-active-bg: rgba(59, 130, 246, 0.08);
    --border-color: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --accent-color: #818cf8;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Global Styles */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
}

/* Helper Typographies */
.fs-7 { font-size: 0.8rem; }
.fs-8 { font-size: 0.7rem; }
.fw-500 { font-weight: 500; }
.fw-400 { font-weight: 400; }
.text-light-gray { color: #cbd5e1; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Login/Auth Styles */
.auth-body {
    background: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e293b 90%);
    overflow: hidden;
}

.auth-card {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    color: #f8fafc;
}

.brand-logo-container {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    font-size: 2rem;
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    font-family: var(--font-secondary);
}

.input-group-modern {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.input-group-modern:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.input-group-modern .input-group-text {
    background: transparent;
    border: none;
    padding-left: 15px;
}

.input-group-modern .form-control {
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: var(--font-secondary);
    padding: 12px 10px;
}

.input-group-modern .form-control:focus {
    box-shadow: none;
    background: transparent;
}

.btn-reveal-password {
    border: none !important;
    color: #94a3b8 !important;
    background: transparent !important;
}

.btn-reveal-password:hover {
    color: #ffffff !important;
}

.btn-modern {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: var(--font-primary);
}

.py-2_5 {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Ambient Blobs */
.blob-1, .blob-2 {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.45;
}
.blob-1 {
    background: #3b82f6;
    top: -50px;
    left: -50px;
}
.blob-2 {
    background: #6366f1;
    bottom: -60px;
    right: -50px;
}

/* SaaS Layout Architecture */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    min-width: 260px;
    max-width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--sidebar-text);
    transition: all 0.3s ease;
    z-index: 999;
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
}

#sidebar.collapsed {
    margin-left: -260px;
}

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

.sidebar-brand {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.25rem;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    padding: 20px 14px;
    list-style: none;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.15rem;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active .sidebar-link {
    color: var(--sidebar-active);
    background-color: var(--sidebar-active-bg);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #64748b;
}

/* Main Content Area */
#content {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    background-color: var(--bg-main);
}

/* Topbar */
.topbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    transition: background-color 0.3s, border-color 0.3s;
}

.btn-toggle-sidebar {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-toggle-sidebar:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Page Containers */
.main-content {
    padding: 30px;
    flex-grow: 1;
}

/* SaaS Cards */
.card-saas {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card-saas:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.06);
}

/* KPI Cards */
.card-kpi {
    border-radius: 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}

.kpi-details h6 {
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.kpi-details h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-icon.primary { background: rgba(59, 130, 246, 0.08); color: #3b82f6; }
.kpi-icon.success { background: rgba(16, 114, 181, 0.08); color: #10b981; }
.kpi-icon.warning { background: rgba(245, 158, 11, 0.08); color: #f59e0b; }
.kpi-icon.danger { background: rgba(239, 68, 68, 0.08); color: #ef4444; }

/* Drag and Drop Zone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    background: rgba(59, 130, 246, 0.01);
    transition: all 0.3s;
    cursor: pointer;
}

.dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.03);
}

.dropzone-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.dropzone:hover .dropzone-icon {
    color: var(--primary-color);
    transform: translateY(-5px);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Modern Forms */
.form-control-modern {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 10px 14px;
    font-family: var(--font-secondary);
}

.form-control-modern:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
}

/* Custom DataTables Styling */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 8px !important;
}

.table {
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 0 !important;
}

.table thead th {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.table tbody tr {
    background-color: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    border-radius: 8px;
    transition: transform 0.2s;
}

.table tbody tr:hover {
    transform: scale(1.002);
}

.table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.table tbody tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Mobile Sidebar Toggle Styles */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: -260px;
        position: fixed;
        height: 100vh;
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    #sidebar.collapsed {
        margin-left: -260px;
    }
}
