/* ============================================
   DetektimiPerPlagjiatur - Dark Glassmorphism Theme
   Kolegji AAB
   ============================================ */

/* === CSS Variables === */
:root {
    color-scheme: light;
    --bg-primary: #fdf6e3;
    --bg-secondary: #fffbeb;
    --bg-tertiary: #fffef7;
    --glass-bg: rgba(217, 119, 6, 0.04);
    --glass-bg-hover: rgba(217, 119, 6, 0.08);
    --glass-border: rgba(231, 212, 173, 0.8);
    --glass-border-hover: rgba(217, 119, 6, 0.35);
    --glass-blur: 20px;

    --primary: #d97706;
    --primary-light: #f59e0b;
    --primary-dark: #991b1b;
    --primary-glow: rgba(217, 119, 6, 0.3);

    --success: #15803d;
    --success-light: #16a34a;
    --success-bg: rgba(21, 128, 61, 0.1);

    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.12);

    --danger: #b91c1c;
    --danger-light: #dc2626;
    --danger-bg: rgba(185, 28, 28, 0.1);

    --info: #d97706;
    --info-light: #f59e0b;
    --info-bg: rgba(217, 119, 6, 0.1);

    --secondary: #78716c;
    --secondary-light: #a8a29e;

    --text-primary: #1c1917;
    --text-secondary: rgba(28, 25, 23, 0.72);
    --text-muted: #78716c;

    --sidebar-width: 280px;
    --header-height: 70px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background gradient effect */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(217, 119, 6, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(153, 27, 27, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, -2%) rotate(3deg); }
}

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

a:hover {
    color: var(--primary);
}

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

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* === Glass Card === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

/* === Layout: App Shell === */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: rgba(253, 246, 227, 0.95);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary-light);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.sidebar-user:hover {
    background: var(--glass-bg-hover);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* === Top Header Bar === */
.top-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(253, 246, 227, 0.5);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header .page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.top-header .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* === Content Area === */
.content-area {
    padding: 32px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px var(--primary-glow);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #fff;
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
    justify-content: center;
}

/* === Form Elements === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(44, 24, 16, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(44, 24, 16, 0.06);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* === Tables === */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(44, 24, 16, 0.05);
}

.data-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 14px 18px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(44, 24, 16, 0.05);
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--glass-bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-light);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-light);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-light);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

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

.stat-card {
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.primary {
    background: rgba(217, 119, 6, 0.15);
    color: var(--primary-light);
}

.stat-card .stat-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-card .stat-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.stat-card .stat-data .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-card .stat-data .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* === Flash Messages / Alerts === */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success-light);
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-light);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning-light);
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--info-light);
}

/* === Pagination === */
.pagination-nav {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
}

.pagination li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.pagination li a:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.pagination li.active a {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* === Section Headers === */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 1.35rem;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* === Error Page === */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.error-container {
    text-align: center;
    padding: 60px;
    max-width: 500px;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
}

/* === Progress Bar === */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(44, 24, 16, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.progress-bar.success { background: linear-gradient(90deg, var(--success), var(--success-light)); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), var(--warning-light)); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger), var(--danger-light)); }
.progress-bar.primary { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }

/* === Loading Spinner === */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

/* === Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.fade-in-up:nth-child(4) { animation-delay: 0.2s; }

/* === Modal === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    padding: 32px;
    animation: fadeInUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* === Utility === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary-color { color: var(--primary-light) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }

/* === Responsive === */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .content-area {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-area {
        padding: 16px;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(44, 24, 16, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(44, 24, 16, 0.22);
}

/* === Actions Column === */
.actions-cell {
    display: flex;
    gap: 6px;
}
