/* PWSIX Account Management System - Global Styles */

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

:root {
    --primary: #8B0000; /* Deep Red from Logo */
    --secondary: #1a1a1a;
    --accent: #ff4444;
    --background: #0f0f12;
    --card-bg: rgba(26, 26, 30, 0.7);
    --text: #e0e0e0;
    --text-muted: #8e8e8e;
    --border: rgba(255, 255, 255, 0.1);
    --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-bright: #ffffff;
    --panel-bg: rgba(20, 20, 25, 0.9);
    --subpanel-bg: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Glassmorphism Classes */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.glass-card {
    background: rgba(30, 30, 35, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

/* Auth Pages (Login) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at center, #2c0b0b 0%, #0f0f12 70%);
}

body.theme-light.auth-wrapper {
    background: radial-gradient(circle at center, #ffe6e6 0%, #f4f4f9 70%);
}
body.theme-glass.auth-wrapper {
    background: transparent;
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem;
    background: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.login-card .logo-container img {
    width: 200px;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #d40000 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
    transform: scale(1.02);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: rgba(15, 15, 18, 0.95);
    border-right: 1px solid var(--border);
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem;
    text-align: center;
}

.sidebar-header img {
    max-width: 150px;
}

.nav-links {
    list-style: none;
    padding: 1rem;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-link i {
    margin-right: 12px;
    font-size: 1.2rem;
}

.nav-link:hover, .nav-link.active {
    background: rgba(139, 0, 0, 0.1);
    color: var(--primary);
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    background-image: radial-gradient(circle at 10% 10%, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 9999;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 1s infinite alternate;
}

/* Tables and Data Presentation */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.data-table tr {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(0, 255, 136, 0.1); color: #00ff88; }
.badge-warning { background: rgba(255, 170, 0, 0.1); color: #ffaa00; }
.badge-danger { background: rgba(255, 68, 68, 0.1); color: #ff4444; }

/* ---------------- THEMES ---------------- */

/* Light Theme */
body.theme-light {
    --primary: #d40000;
    --background: #f4f4f9;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text: #333333;
    --text-muted: #666666;
    --border: rgba(0, 0, 0, 0.1);
}

body.theme-light .glass-card,
body.theme-light .login-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body.theme-light .form-input, body.theme-light .data-table tr {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}
body.theme-light .form-input:focus {
    background: rgba(255, 255, 255, 1);
}

body.theme-light .sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

body.theme-light .main-content {
    background-image: none;
}
body.theme-light h1, body.theme-light h3, body.theme-light h2 {
    color: var(--text-bright) !important;
}

/* Fast CSS Variable Overrides for Light Mode (Fixes freezing & text contrast) */
body.theme-light {
    --text-bright: #000000;
    --panel-bg: rgba(255, 255, 255, 0.95);
    --subpanel-bg: rgba(0, 0, 0, 0.03);
}

/* Glassmorphism Extremo Theme */
body.theme-glass {
    --background: transparent;
}
body.theme-glass::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(135deg, #1f0101, #300000, #0a0f18, #001020);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.theme-glass .glass-card,
body.theme-glass .login-card,
body.theme-glass .sidebar {
    background: rgba(20, 20, 25, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
}

body.theme-glass .form-input {
    background: rgba(255, 255, 255, 0.05);
}

/* Print Optimization (PDF Export) */
@media print {
    .sidebar, 
    .dashboard-header, 
    .nav-links, 
    .btn, 
    .form-group,
    form,
    .dropdown-export,
    .dashboard-stats,
    .user-profile,
    .modal-overlay,
    .dashboard-stats i {
        display: none !important;
    }

    /* Keep the Title but hide button container */
    .glass-card > div:first-child > div:last-child {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .app-container {
        display: block !important;
    }

    .glass-card {
        background: transparent !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 10pt !important;
        color: #000 !important;
    }

    .data-table th, 
    .data-table td {
        padding: 8px !important;
        border: 1px solid #ddd !important;
        color: #000 !important;
        background: #fff !important;
    }

    /* Hide the Actions column in print */
    .data-table th:last-child, 
    .data-table td:last-child {
        display: none !important;
    }

    h3, h4, h2, p {
        color: #000 !important;
        margin-bottom: 10px !important;
    }

    /* Reset transitions and animations */
    * {
        animation: none !important;
        transition: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }
}

/* Mobile & Tablet Responsiveness */
@media screen and (max-width: 1024px) {
    .sidebar { width: 80px; padding: 1rem; }
    .sidebar .logo-container img { width: 40px; }
    .sidebar span { display: none; }
    .sidebar .nav-link { justify-content: center; }
    .sidebar .nav-link i { margin-right: 0; font-size: 1.2rem; }
    .main-content { margin-left: 80px; }
}

@media screen and (max-width: 992px) {
    #mobile-toggle { display: flex !important; }
    .app-container { display: block; }
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        width: 250px;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s ease;
        display: flex !important;
        flex-direction: column !important;
        background: var(--background) !important;
    }
    .sidebar.active { left: 0; }
    .sidebar span { display: inline; }
    .sidebar .nav-link { justify-content: flex-start; }
    .sidebar .nav-link i { margin-right: 15px; }
    .main-content { margin-left: 0 !important; width: 100%; padding: 1rem; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .user-profile { width: 100%; justify-content: space-between; }
}

@media screen and (max-width: 768px) {
    .dashboard-stats { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
    .glass-card { padding: 1.2rem; }
    .table-container { overflow-x: auto; }
}
