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

:root {
    /* Gradient from user requirements: #7B6CF6 -> #4F8DF7 -> #2EC4C4 */
    --primary-gradient: linear-gradient(135deg, #7B6CF6 0%, #4F8DF7 50%, #2EC4C4 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    --text-primary: #111111;
    --text-secondary: #4a5568;
    --text-light: #f7fafc;

    --primary-color: #4F8DF7;
    /* Middle of gradient */
    --secondary-color: #7B6CF6;
    /* Start of gradient */
    --success-color: #2EC4C4;
    /* End of gradient */
    --danger-color: #ff5b5b;
    --warning-color: #f6b93b;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
}

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

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

/* Modern Button System 
   Includes .btn (generic), .btn-primary, .btn-success, .btn-danger, .btn-sm, .btn-full
*/
.btn,
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    gap: 8px;
    text-decoration: none;
    /* Ensure links look like buttons */
    background-color: #f1f2f6;
    color: var(--text-secondary);
}

.btn:hover,
.btn-modern:hover {
    background-color: #e1e2e6;
    transform: translateY(-1px);
    color: var(--text-primary);
}

.btn-primary,
.btn-modern.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 141, 247, 0.3);
}

.btn-primary:hover,
.btn-modern.btn-primary:hover {
    background: linear-gradient(135deg, #6c5ce7 0%, #487eb0 100%);
    /* Slightly darker gradient */
    color: white;
    box-shadow: 0 6px 16px rgba(79, 141, 247, 0.4);
}

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

.btn-success:hover {
    background-color: #26a5a5;
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #ff4757;
    color: white;
}

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

.btn-full {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Form Elements */
.input-modern,
input[type="text"],
input[type="password"],
input[type="email"],
select,
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
    box-sizing: border-box;
    /* Important for widths */
}

.input-modern:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 141, 247, 0.1);
}

.form-label,
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    /* Allows border radius */
    border-spacing: 0;
    width: 100%;
    margin-bottom: 20px;
}

th {
    text-align: left;
    padding: 16px;
    background-color: #f8f9fa;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 16px;
    border-bottom: 1px solid #edf2f7;
    color: var(--text-primary);
    vertical-align: middle;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-img {
    height: 48px;
    width: auto;
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Utilities */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: white;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    font-size: 14px;
}

.pagination a:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Card Alias for backward compatibility/admin */
.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error,
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

/* Admin Layout & Sidebar */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    text-decoration: none;
}

.sidebar-logo {
    height: 32px;
    width: auto;
}

.sidebar-brand h2 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-left: 12px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background: rgba(79, 141, 247, 0.1);
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 141, 247, 0.3);
}

.sidebar-menu .icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Stats Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
}

.stat-card h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Stat Card Variants (Border accents instead of full backgrounds) */
.stat-card.info {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left: 4px solid var(--success-color);
}

.stat-card.warning {
    border-left: 4px solid var(--warning-color);
}

.stat-card.danger {
    border-left: 4px solid var(--danger-color);
    /* For the failed card which uses inline style usually, but lets standardize */
}

/* Progress Bar */
.progress-bar-container {
    background-color: #edf2f7;
    border-radius: var(--radius-sm);
    height: 24px;
    overflow: hidden;
    margin: 15px 0;
    position: relative;
    border: 1px solid #e2e8f0;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar.complete {
    background: var(--success-color);
}