/**
 * Cursos SystemDIM - Admin Styles
 * Baseado no DIM Theme do SystemDIM
 */

/* ============================================
   VARIÁVEIS CSS - DIM Theme (Dark Mode Default)
   ============================================ */
:root {
    /* Tom dourado corporativo */
    --dim-gold: #E5A93C;
    --dim-gold-2: #C48A28;
    --dim-gold-light: rgba(229, 169, 60, 0.15);
    --dim-gold-glow: rgba(229, 169, 60, 0.4);

    /* Dark mode - cinzentos profundos */
    --dim-dark: #0d0d10;
    --dim-dark-2: #121215;
    --dim-dark-3: #1a1a1e;
    --dim-dark-4: #252529;
    --dim-dark-5: #2f2f35;

    --dim-page-bg: #0d0d10;
    --dim-text: #f0f0f0;
    --dim-text-muted: #6b6b75;
    --dim-text-secondary: #9a9aa3;

    --dim-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    --dim-shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
    --dim-border: rgba(255, 255, 255, 0.06);
    --dim-border-light: rgba(255, 255, 255, 0.1);

    /* Cores de estado */
    --dim-success: #10b981;
    --dim-error: #ef4444;
    --dim-warning: #f59e0b;
    --dim-info: #3b82f6;

    /* Superfícies */
    --dim-surface-0: #0d0d10;
    --dim-surface-1: #121215;
    --dim-surface-2: #16161b;
    --dim-surface-3: #1a1a1e;
    --dim-surface-4: #252529;

    /* Gradients */
    --dim-card-gradient: linear-gradient(160deg, #16161b, #0f0f12);
    --dim-header-gradient: linear-gradient(180deg, #1a1a1e, #121215);
    --dim-sidebar-gradient: linear-gradient(180deg, #1a1a1e, #0d0d10);

    /* Sombras */
    --dim-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --dim-shadow-deep: 0 18px 45px rgba(0, 0, 0, 0.45);
    --dim-shadow-card: 0 5px 14px rgba(0, 0, 0, 0.3);

    /* Realces dourados */
    --dim-gold-glow-subtle: rgba(229, 169, 60, 0.18);
    --dim-gold-border-subtle: rgba(229, 169, 60, 0.12);
    --dim-gold-surface-subtle: rgba(229, 169, 60, 0.08);

    /* Sidebar */
    --dim-sidebar-bg: var(--dim-sidebar-gradient);
    --dim-sidebar-text: #f0f0f0;
    --dim-sidebar-border: rgba(255, 255, 255, 0.06);

    /* Header */
    --dim-header-bg: var(--dim-header-gradient);
    --dim-header-border: rgba(255, 255, 255, 0.06);

    /* Cards */
    --dim-card-bg: var(--dim-card-gradient);
    --dim-card-border: rgba(255, 255, 255, 0.06);

    /* Inputs */
    --dim-input-bg: #17171c;
    --dim-input-border: rgba(255, 255, 255, 0.1);
    --dim-input-text: #f0f0f0;
    --dim-input-placeholder: #6b6b75;

    /* Tabelas */
    --dim-table-bg: transparent;
    --dim-table-header-bg: #16161a;
    --dim-table-row-hover: rgba(255, 255, 255, 0.03);
    --dim-table-border: rgba(255, 255, 255, 0.06);
}

/* ============================================
   LIGHT MODE
   ============================================ */
:root[data-theme="light"] {
    /* Tom dourado mais escuro para contraste */
    --dim-gold: #C48A28;
    --dim-gold-2: #A67320;
    --dim-gold-light: rgba(196, 138, 40, 0.15);
    --dim-gold-glow: rgba(196, 138, 40, 0.4);

    /* Light mode - cinzentos claros */
    --dim-dark: #f4f5f7;
    --dim-dark-2: #ffffff;
    --dim-dark-3: #e8e9eb;
    --dim-dark-4: #d1d3d6;
    --dim-dark-5: #9ca3af;

    --dim-page-bg: #f4f5f7;
    --dim-text: #1a1d23;
    --dim-text-muted: #6b7280;
    --dim-text-secondary: #9ca3af;

    --dim-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    --dim-shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.2);
    --dim-border: rgba(0, 0, 0, 0.1);
    --dim-border-light: rgba(0, 0, 0, 0.15);

    /* Cores de estado */
    --dim-success: #059669;
    --dim-error: #dc2626;
    --dim-warning: #d97706;
    --dim-info: #2563eb;

    /* Superfícies */
    --dim-surface-0: #f4f5f7;
    --dim-surface-1: #ffffff;
    --dim-surface-2: #f8f9fa;
    --dim-surface-3: #e9ecef;
    --dim-surface-4: #e5e7eb;

    /* Gradients */
    --dim-card-gradient: #ffffff;
    --dim-header-gradient: #ffffff;
    --dim-sidebar-gradient: #f8f9fa;

    /* Sombras */
    --dim-shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
    --dim-shadow-deep: 0 8px 24px rgba(0, 0, 0, 0.12);
    --dim-shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);

    /* Realces dourados */
    --dim-gold-glow-subtle: rgba(196, 138, 40, 0.15);
    --dim-gold-border-subtle: rgba(196, 138, 40, 0.2);
    --dim-gold-surface-subtle: rgba(196, 138, 40, 0.08);

    /* Sidebar */
    --dim-sidebar-bg: #f8f9fa;
    --dim-sidebar-text: #1a1d23;
    --dim-sidebar-border: rgba(0, 0, 0, 0.08);

    /* Header */
    --dim-header-bg: #ffffff;
    --dim-header-border: rgba(0, 0, 0, 0.1);

    /* Cards */
    --dim-card-bg: #ffffff;
    --dim-card-border: rgba(0, 0, 0, 0.08);

    /* Inputs */
    --dim-input-bg: #ffffff;
    --dim-input-border: rgba(0, 0, 0, 0.15);
    --dim-input-text: #1a1d23;
    --dim-input-placeholder: #9ca3af;

    /* Tabelas */
    --dim-table-bg: #ffffff;
    --dim-table-header-bg: #f8f9fa;
    --dim-table-row-hover: rgba(0, 0, 0, 0.03);
    --dim-table-border: rgba(0, 0, 0, 0.1);
}

/* ============================================
   CSS RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dim-page-bg);
    color: var(--dim-text);
    display: flex;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 280px;
    background: var(--dim-sidebar-bg);
    color: var(--dim-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    border-right: 1px solid var(--dim-sidebar-border);
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--dim-sidebar-border);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dim-sidebar-text);
}

.sidebar-header span {
    color: var(--dim-gold);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav a {
    display: block;
    padding: 14px 24px;
    color: var(--dim-text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: var(--dim-surface-2);
    color: var(--dim-text);
}

.sidebar-nav a.active {
    background: var(--dim-gold-surface-subtle);
    color: var(--dim-gold);
    border-left: 3px solid var(--dim-gold);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--dim-sidebar-border);
}

.sidebar-footer .user-info {
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--dim-text-muted);
}

.sidebar-footer button {
    width: 100%;
    padding: 12px;
    background: var(--dim-surface-2);
    color: var(--dim-text);
    border: 1px solid var(--dim-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sidebar-footer button:hover {
    background: var(--dim-surface-3);
    border-color: var(--dim-gold);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 32px;
}

/* ============================================
   HEADER
   ============================================ */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.content-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dim-text);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--dim-surface-2);
    color: var(--dim-text);
    text-decoration: none;
    border: 1px solid var(--dim-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--dim-surface-3);
    border-color: var(--dim-border-light);
}

.btn-success {
    background: var(--dim-success);
    color: white;
    border: none;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--dim-error);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--dim-warning);
    color: white;
    border: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--dim-card-bg);
    border: 1px solid var(--dim-card-border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--dim-shadow-card);
    margin-bottom: 24px;
}

.card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dim-text);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dim-table-bg);
}

thead {
    background: var(--dim-table-header-bg);
}

th {
    text-align: left;
    padding: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dim-text-secondary);
    border-bottom: 1px solid var(--dim-table-border);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--dim-table-border);
}

tbody tr:hover {
    background: var(--dim-table-row-hover);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--dim-error);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--dim-warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--dim-info);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dim-text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--dim-input-bg);
    color: var(--dim-input-text);
    border: 1px solid var(--dim-input-border);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--dim-gold);
    background: var(--dim-dark-3);
    box-shadow: 0 0 0 3px var(--dim-gold-glow-subtle);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23A1A1AA%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 10px auto;
    padding-right: 44px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--dim-error);
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--dim-success);
}

/* ============================================
   ACTIONS
   ============================================ */
.actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--dim-card-bg);
    border: 1px solid var(--dim-card-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--dim-shadow-card);
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: var(--dim-gold);
    margin-bottom: 8px;
}

.stat-card .label {
    color: var(--dim-text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h1,
    .sidebar-nav a span,
    .sidebar-footer .user-info {
        display: none;
    }
    
    .sidebar-nav a {
        text-align: center;
        padding: 15px;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .content-header h2 {
        font-size: 24px;
    }
}
