@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #14b8a6;
    --bg-dark: #0f172a;
    --bg-darker: #0b1120;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --bg-panel-solid: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --danger: #ef4444;
    --success: #22c55e;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    /* UI Restrictions */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Typography & Utilities */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 600; }
a { color: var(--primary); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--accent); }

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(14, 165, 233, 0.1);
}

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

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-panel-solid);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: 0.3s;
}

.brand {
    padding: 2rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.brand i {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-menu {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--text-main);
}

.nav-item.active {
    border-left: 3px solid var(--primary);
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}

.user-profile {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    background: radial-gradient(circle at top right, #1e293b 0%, var(--bg-darker) 100%);
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

/* Card Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    transition: transform 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.course-thumbnail {
    width: 100%;
    height: 160px;
    background: #334155;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    object-fit: cover;
}

.progress-bar {
    height: 6px;
    background: #334155;
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 1s ease-out;
}

/* Badges */
.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.badge-locked { background: rgba(0,0,0,0.7); color: var(--text-muted); }
.badge-active { background: rgba(14, 165, 233, 0.9); color: white; }

/* Video Player with DRM Prototype */
.video-wrapper {
    position: relative;
    width: 100%;
    background: black;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    aspect-ratio: 16/9;
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drm-watermark {
    position: absolute;
    top: 20%;
    left: 20%;
    color: rgba(255, 255, 255, 0.25);
    font-size: 1.5rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 50;
    user-select: none;
    animation: drift 15s linear infinite;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(100px, 50px); }
    50% { transform: translate(50px, 150px); }
    75% { transform: translate(-50px, 50px); }
    100% { transform: translate(0, 0); }
}

/* Custom Login Page */
.login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, var(--bg-dark), var(--bg-darker));
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: white;
    outline: none;
    transition: 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Live Session Banner */
.live-banner {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-left: 4px solid var(--danger);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulseRed 2s infinite;
    margin-right: 8px;
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}
