/* assets/css/style.css */

/* Import Premium Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ec4899;
    --accent: #8b5cf6;

    /* Light Theme (Default) */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --hover-bg: #f1f5f9;
    --table-header: #f8fafc;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --backdrop-blur: 12px;
}

[data-theme='dark'] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --hover-bg: #334155;
    --table-header: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-4 {
    gap: 1rem;
}

.gap-2 {
    gap: 0.5rem;
}

.hidden {
    display: none;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger);
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--hover-bg);
    border-color: var(--text-muted);
}

.card {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, background-color 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-input,
.form-select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Header (Theme Aware) */
.app-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
    transition: background-color 0.3s;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    color: transparent;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-body);
    transition: background-color 0.3s;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, padding 0.3s ease, background-color 0.3s;
}

.sidebar.collapsed {
    width: 80px;
    padding: 2rem 0.75rem;
}

.sidebar.collapsed .logo,
.sidebar.collapsed .nav-link span:last-child,
/* Text span */
.sidebar.collapsed .text-sm {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .submenu {
    padding-left: 0;
    align-items: center;
}

.main-content {
    flex-grow: 1;
    padding: 2.5rem;
    max-width: 1920px;
    /* Expanded for wide screens */
    margin: 0 auto;
    transition: padding 0.3s;
}

/* Sidebar Nav */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--hover-bg);
    color: var(--text-main);
}

.nav-link.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

tr {
    border-bottom: 1px solid var(--border);
}

tr:last-child {
    border-bottom: none;
}

th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--table-header);
}

td {
    padding: 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Landing Page Styles */
.hero-section {
    background: linear-gradient(135deg, var(--bg-body) 0%, rgba(79, 70, 229, 0.1) 100%);
    padding: 6rem 0;
    text-align: center;
}

.stats-section {
    padding: 4rem 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.cta-section {
    background: var(--text-main);
    color: var(--bg-body);
    padding: 5rem 0;
    text-align: center;
}

.cta-section h2 {
    color: var(--bg-body);
}

.cta-section .btn {
    background: var(--bg-body);
    color: var(--text-main);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    line-height: 1.7;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}