/* assets/css/style.css */
:root {
    --primary: #E11D48; /* Vibrant Rose/Red */
    --primary-hover: #BE123C;
    --secondary: #10B981;
    --background: #F8FAFC; /* Softer, cooler gray/white */
    --surface: #FFFFFF;
    --text-main: #0F172A; /* Very dark slate */
    --text-muted: #64748B;
    --border: #E2E8F0;
    --error: #EF4444;
    --success: #10B981;
    --radius: 16px; /* Rounder corners */
    --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05); /* Softer, larger shadow */
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.text-muted { color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-success {
    background-color: var(--primary);
    color: white;
}

.btn-success:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background-color: var(--primary);
    color: white;
}

.btn-danger:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Auth Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background-color: #FEF2F2;
    color: var(--error);
    border: 1px solid #FCA5A5;
}

.alert-success {
    background-color: #ECFDF5;
    color: var(--success);
    border: 1px solid #6EE7B7;
}

/* Dashboard Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    gap: 0.75rem;
}

.nav-link:hover, .nav-link.active {
    background: var(--background);
    color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Tables */
.table-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-error { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    min-width: 250px;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-out 3s forwards;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; }
}

/* ====================
   Responsive Design
   ==================== */
@media (max-width: 768px) {
    /* Bottom Navigation Bar */
    .layout {
        flex-direction: column;
        padding-bottom: 70px; /* Space for bottom nav */
    }
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0 5px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.4);
        box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        overflow: visible;
        max-height: none;
    }
    .sidebar .sidebar-logo, 
    .sidebar > div[style*="padding"] {
        display: none !important; /* Hide logo and profile info */
    }
    .sidebar nav {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        align-items: center;
        height: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 0 10px;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    .sidebar nav::-webkit-scrollbar {
        display: none;
    }
    .sidebar > div:last-child {
        display: none !important; /* Hide duplicate logout button on mobile */
    }
    .nav-link {
        flex: 0 0 auto;
        width: 72px;
        flex-direction: column;
        justify-content: center;
        padding: 0.4rem;
        margin-bottom: 0;
        font-size: 0.65rem;
        font-weight: 600;
        gap: 5px;
        text-align: center;
        border-radius: 12px;
        transition: all 0.2s ease;
        height: 80%;
    }
    .nav-link i {
        font-size: 1.35rem;
        transition: transform 0.2s ease;
    }
    .nav-link:hover, .nav-link.active {
        background: rgba(225, 29, 72, 0.08); /* Light primary */
        color: var(--primary);
    }
    .nav-link:hover i, .nav-link.active i {
        transform: translateY(-2px);
    }
    body.sidebar-open .sidebar {
        max-height: none;
        padding: 0;
    }
    .menu-toggle {
        display: none; /* Hide hamburger entirely */
    }
    .nav-link {
        padding: 0.75rem 1rem;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-header {
    display: none;
}
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
    }
    .sidebar .sidebar-logo {
        display: none; /* Hide logo in sidebar on mobile since it's in the header */
    }
    .main-content {
        padding: 1rem; /* Reduce padding on mobile */
    }
    .card {
        padding: 1.25rem; /* Reduce padding on mobile */
    }
    .profile-grid, div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important; /* Stack columns on mobile */
    }
    body {
        overflow-wrap: anywhere;
        word-wrap: break-word; /* Prevent long emails/text from breaking screen width */
    }
}
