/* ============================================================================
   LMS PLATFORM - TAILWIND CSS CONFIGURATION
   Phase 13: Modern UI Framework
   ============================================================================ */

/*
   Tailwind CSS is loaded via CDN in HTML files.
   This file contains custom CSS variables and component overrides.
*/

/* ============================================================================
   DESIGN SYSTEM - CSS CUSTOM PROPERTIES
   ============================================================================ */

:root {
    /* Primary Colors - Teal Brand */
    --color-primary-50: #ecfeff;
    --color-primary-100: #cffafe;
    --color-primary-200: #a5f3fc;
    --color-primary-300: #67e8f9;
    --color-primary-400: #22d3ee;
    --color-primary-500: #0d7377;
    --color-primary-600: #0a5c5f;
    --color-primary-700: #084547;
    --color-primary-800: #063031;
    --color-primary-900: #041f20;

    /* Secondary Colors */
    --color-secondary-500: #14919b;
    --color-secondary-600: #107a83;

    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-error: #ef4444;
    --color-error-light: #fee2e2;
    --color-info: #3b82f6;
    --color-info-light: #dbeafe;

    /* Light Mode (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-color-dark: #cbd5e1;

    /* Shadows */
    --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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;

    /* Transitions */
    --transition-fast: 150ms;
    --transition-normal: 200ms;
    --transition-slow: 300ms;
}

/* ============================================================================
   DARK MODE
   ============================================================================ */

.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --border-color-dark: #475569;

    /* Dark mode shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Theme transition */
body.theme-transitioning,
body.theme-transitioning * {
    transition: background-color var(--transition-normal) ease,
                color var(--transition-normal) ease,
                border-color var(--transition-normal) ease !important;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

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

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

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

/* ============================================================================
   FORM ELEMENTS - CUSTOM STYLING
   ============================================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
textarea,
select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

/* ============================================================================
   SKELETON LOADERS
   ============================================================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
}

.skeleton-card {
    height: 12rem;
}

.skeleton-button {
    height: 2.5rem;
    width: 6rem;
}

/* ============================================================================
   SPINNER LOADING
   ============================================================================ */

.spinner {
    display: inline-block;
    border: 2px solid var(--border-color);
    border-top-color: var(--color-primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
}

.spinner-md {
    width: 1.5rem;
    height: 1.5rem;
}

.spinner-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

.spinner-xl {
    width: 4rem;
    height: 4rem;
    border-width: 4px;
}

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

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: -0.625rem;
    margin-left: -0.625rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    color: white;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

/* Fade in */
.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide up */
.animate-slide-up {
    animation: slideUp var(--transition-normal) ease-out;
}

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

/* Slide down */
.animate-slide-down {
    animation: slideDown var(--transition-normal) ease-out;
}

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

/* Scale in */
.animate-scale-in {
    animation: scaleIn var(--transition-fast) ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shake (for errors) */
.animate-shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-8px); }
    80% { transform: translateX(8px); }
}

/* Pulse (for notifications) */
.animate-pulse-once {
    animation: pulseOnce 0.5s ease-out;
}

@keyframes pulseOnce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================================================
   NOTIFICATIONS / TOAST
   ============================================================================ */

.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 24rem;
}

.notification {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--color-primary-500);
    animation: slideIn var(--transition-normal) ease-out;
}

.notification.success {
    border-left-color: var(--color-success);
}

.notification.error {
    border-left-color: var(--color-error);
}

.notification.warning {
    border-left-color: var(--color-warning);
}

.notification.info {
    border-left-color: var(--color-info);
}

.notification-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.notification-close {
    flex-shrink: 0;
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.notification-close:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.removing {
    animation: slideOut var(--transition-fast) ease-in forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================================================
   MODAL STYLES
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 8rem);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ============================================================================
   CARD COMPONENT
   ============================================================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-hover {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================================================
   BADGE COMPONENT
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background: rgba(13, 115, 119, 0.1);
    color: var(--color-primary-500);
}

.badge-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-error {
    background: var(--color-error-light);
    color: var(--color-error);
}

.badge-info {
    background: var(--color-info-light);
    color: var(--color-info);
}

.dark .badge-primary {
    background: rgba(13, 115, 119, 0.2);
}

.dark .badge-success {
    background: rgba(16, 185, 129, 0.2);
}

.dark .badge-warning {
    background: rgba(245, 158, 11, 0.2);
}

.dark .badge-error {
    background: rgba(239, 68, 68, 0.2);
}

.dark .badge-info {
    background: rgba(59, 130, 246, 0.2);
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */

.progress-bar {
    height: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary-500);
    border-radius: 9999px;
    transition: width var(--transition-slow) ease-out;
}

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

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */

/* Mobile navigation */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    button,
    a,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================================================
   MOBILE-FIRST RESPONSIVE IMPROVEMENTS
   ============================================================================ */

/* Mobile table responsiveness */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Convert table to cards on mobile */
    .table-cards thead {
        display: none;
    }

    .table-cards tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--bg-card);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-color);
        padding: 1rem;
    }

    .table-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }

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

    .table-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    /* Mobile sidebar overlay */
    .sidebar-open {
        overflow: hidden;
    }

    /* Mobile grid adjustments */
    .grid-mobile-stack {
        grid-template-columns: 1fr !important;
    }

    /* Mobile form improvements */
    .form-row-mobile {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    /* Mobile modal full screen */
    .modal-container {
        max-width: 100% !important;
        max-height: 100% !important;
        height: 100%;
        border-radius: 0 !important;
        margin: 0;
    }

    .modal-body {
        max-height: calc(100vh - 10rem) !important;
    }

    /* Mobile button stack */
    .btn-group-mobile {
        flex-direction: column !important;
        width: 100%;
    }

    .btn-group-mobile > * {
        width: 100%;
        justify-content: center;
    }

    /* Mobile stats cards */
    .stats-grid-mobile {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Mobile padding adjustments */
    .container-mobile {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Mobile card padding */
    .card-mobile {
        padding: 1rem !important;
    }

    /* Mobile text sizes */
    .text-mobile-sm {
        font-size: 0.875rem !important;
    }

    .text-mobile-base {
        font-size: 1rem !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .stats-grid-mobile {
        grid-template-columns: 1fr !important;
    }

    /* Extra small modal adjustments */
    .modal-backdrop {
        padding: 0 !important;
    }

    /* Smaller fonts for tiny screens */
    h1, .text-3xl {
        font-size: 1.5rem !important;
    }

    h2, .text-2xl {
        font-size: 1.25rem !important;
    }
}

/* Tablet specific */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-tablet-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================================
   ERROR STATES
   ============================================================================ */

.error-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.error-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: var(--color-error);
}

.error-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.error-state-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
}

.empty-state-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--text-tertiary);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-message {
    color: var(--text-secondary);
    max-width: 24rem;
    margin: 0 auto 1.5rem;
}

/* ============================================================================
   LOADING STATES - ENHANCED
   ============================================================================ */

/* Content placeholder shimmer */
.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton card */
.skeleton-card-full {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.skeleton-card-full .skeleton-image {
    height: 10rem;
    background: var(--bg-tertiary);
}

.skeleton-card-full .skeleton-content {
    padding: 1rem;
}

.skeleton-card-full .skeleton-title {
    height: 1.25rem;
    width: 70%;
    margin-bottom: 0.75rem;
}

.skeleton-card-full .skeleton-description {
    height: 0.875rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-card-full .skeleton-description:last-child {
    width: 60%;
}

/* Full page loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-overlay.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Inline loading indicator */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Button with loading spinner */
.btn-with-spinner {
    position: relative;
    transition: all var(--transition-fast);
}

.btn-with-spinner.loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-with-spinner.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: 1.25rem;
    margin: -0.625rem 0 0 -0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ============================================================================
   RETRY BUTTON STYLES
   ============================================================================ */

.retry-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--color-primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.retry-button:hover {
    background: var(--color-primary-600);
}

.retry-button svg {
    width: 1rem;
    height: 1rem;
}

/* ============================================================================
   CHART CONTAINER STYLES
   ============================================================================ */

.chart-container {
    position: relative;
    width: 100%;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.chart-container canvas {
    max-width: 100%;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.chart-legend-color {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
}

/* ============================================================================
   VIDEO PROGRESS BAR
   ============================================================================ */

.video-progress-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.video-progress-bar {
    height: 100%;
    background: var(--color-primary-500);
    transition: width 0.1s linear;
}

.video-progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--border-color);
    pointer-events: none;
}

/* ============================================================================
   CERTIFICATE STYLES
   ============================================================================ */

.certificate-preview {
    aspect-ratio: 1.414;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.certificate-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.certificate-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================================
   NOTIFICATION BADGE
   ============================================================================ */

.notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    background: var(--color-error);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge.pulse {
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================================================
   SEARCH INPUT STYLES
   ============================================================================ */

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input-wrapper input {
    padding-left: 2.75rem;
    padding-right: 2.75rem;
}

.search-input-wrapper .clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.search-input-wrapper input:not(:placeholder-shown) + .clear-btn,
.search-input-wrapper input:focus + .clear-btn {
    opacity: 1;
}

.search-input-wrapper .clear-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* ============================================================================
   FILTER CHIPS
   ============================================================================ */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    border-color: var(--color-primary-500);
    color: var(--color-primary-500);
}

.filter-chip.active {
    background: var(--color-primary-500);
    border-color: var(--color-primary-500);
    color: white;
}

.filter-chip .remove-btn {
    display: none;
    margin-left: 0.25rem;
}

.filter-chip.active .remove-btn {
    display: inline;
}

/* ============================================================================
   GRADE DISPLAY
   ============================================================================ */

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

.grade-badge.grade-a {
    background: var(--color-success-light);
    color: var(--color-success);
}

.grade-badge.grade-b {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.grade-badge.grade-c {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.grade-badge.grade-d {
    background: rgba(249, 115, 22, 0.15);
    color: #ea580c;
}

.grade-badge.grade-f {
    background: var(--color-error-light);
    color: var(--color-error);
}

.dark .grade-badge.grade-a {
    background: rgba(16, 185, 129, 0.2);
}

.dark .grade-badge.grade-b {
    background: rgba(34, 197, 94, 0.2);
}

.dark .grade-badge.grade-c {
    background: rgba(245, 158, 11, 0.2);
}

.dark .grade-badge.grade-d {
    background: rgba(249, 115, 22, 0.2);
}

.dark .grade-badge.grade-f {
    background: rgba(239, 68, 68, 0.2);
}

/* ============================================================================
   SCROLLBAR STYLING
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color-dark) var(--bg-secondary);
}
