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

:root {
    /* Light Mode Variables */
    --bg-color: #f3f4f6;
    --surface-color: rgba(255, 255, 255, 0.7);
    --surface-solid: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --accent-color: #1A2359;
    --accent-hover: #232F73;
    --border-color: rgba(26, 35, 89, 0.15); /* A subtle blue border instead of black/grey */
    --success: #2C8B5B;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-color: #111827;
    --surface-color: rgba(31, 41, 55, 0.7);
    --surface-solid: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --accent-color: #6366f1;
    --accent-hover: #818cf8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-hover);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface-solid);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}
.sidebar-logo {
    margin-bottom: 32px;
    text-align: center;
}
.sidebar-logo img {
    max-height: 40px;
    width: auto;
}
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--accent-color);
    cursor: pointer;
}
.nav-links {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
}
.nav-item i {
    margin-right: 12px;
    font-size: 18px;
    color: var(--accent-color);
    opacity: 0.8;
}
.nav-item:hover i, .nav-item.active i {
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
}
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.page-title {
    font-size: 24px;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0;
}
.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background: var(--surface-solid);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 15px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--success));
    color: white;
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #33a06a);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Auth Page */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-color) 0%, rgba(99, 102, 241, 0.1) 100%);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}
.auth-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table tr:last-child td {
    border-bottom: none;
}
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Background Shapes for Glassmorphism */
.bg-shape {
    position: absolute;
    filter: blur(100px);
    z-index: -1;
    border-radius: 50%;
}
.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.2);
    top: -100px;
    left: -100px;
}
.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.2);
    bottom: -50px;
    right: -50px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        z-index: 10;
    }
    
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .sidebar-logo {
        margin-bottom: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        margin-top: 16px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .verify-container {
        padding: 20px;
        margin: 20px auto;
    }
    
    .cert-card {
        padding: 16px;
    }

    /* Form flex rows */
    .form-group[style*="display: flex;"], 
    div[style*="display: flex; gap: 24px;"],
    div[style*="display: grid; grid-template-columns: repeat(2, 1fr);"] {
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
    }

    div[style*="flex: 2;"], div[style*="flex: 3;"], div[style*="flex: 1.5;"], div[style*="width: 350px;"], div[style*="width: 400px;"] {
        width: 100% !important;
        flex: none !important;
    }
}
