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

:root {
    --primary: #1a1a2e;
    --accent: #e94560;
    --accent-hover: #c73550;
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-light: #666;
    --border: #e0e0e0;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navbar ──────────────────────────────────────────────── */
.navbar {
    background: var(--primary);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.footer {
    position: relative;
    z-index: 1;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    text-decoration: none;
}

.nav-links a:hover { color: #fff; text-decoration: none; }

.nav-user {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

.btn-logout {
    color: var(--accent) !important;
    font-weight: 600;
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    .nav-links.active { display: flex; }
}

/* ─── Container ───────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ─── Hero / Landing ──────────────────────────────────────── */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    margin: -2rem -1rem;
    padding: 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.4rem);
    opacity: 0.8;
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.btn-full { width: 100%; text-align: center; }

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-danger:hover { background: #b02a37; }

/* ─── Login ───────────────────────────────────────────────── */
.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    background: var(--card);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

/* ─── Forms ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

.form-card {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] { width: auto; }

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info { background: #d1ecf1; color: #0c5460; }

/* ─── Page ────────────────────────────────────────────────── */
.page-section { padding: 1rem 0; }

.page-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.page-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    margin-top: -1rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header .page-title { margin-bottom: 0; }

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.back-link:hover { color: var(--accent); }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ─── Courses Grid ────────────────────────────────────────── */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.course-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    text-decoration: none;
}

.course-thumb {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: rgba(255,255,255,0.7);
}

.course-info {
    padding: 1rem;
}

.course-info h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.course-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ─── Videos ──────────────────────────────────────────────── */
.videos-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.video-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-title {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.video-player {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ─── Stats ───────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    display: block;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-link { font-size: 0.85rem; }

/* ─── Tables ──────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table th {
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td { font-size: 0.9rem; }

.truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.inline-form { display: inline; }

/* ─── Animated Waves Background ──────────────────────────── */
.waves-bg {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.waves-bg svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
}

.wave {
    stroke: none;
}

.wave1 {
    fill: rgba(233,69,96,0.07);
    animation: waveMove1 8s ease-in-out infinite;
}

.wave2 {
    fill: rgba(26,26,46,0.06);
    animation: waveMove2 10s ease-in-out infinite;
}

.wave3 {
    fill: rgba(233,69,96,0.04);
    animation: waveMove3 12s ease-in-out infinite;
}

.wave4 {
    fill: rgba(15,52,96,0.05);
    animation: waveMove4 14s ease-in-out infinite;
}

@keyframes waveMove1 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-25%); }
}

@keyframes waveMove2 {
    0%, 100% { transform: translateX(-10%); }
    50% { transform: translateX(15%); }
}

@keyframes waveMove3 {
    0%, 100% { transform: translateX(5%); }
    50% { transform: translateX(-20%); }
}

@keyframes waveMove4 {
    0%, 100% { transform: translateX(-15%); }
    50% { transform: translateX(10%); }
}

/* ─── Footer ──────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ─── Violations / Acessos Simultâneos ───────────────────── */
.violations-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.violations-title { margin-bottom: 0 !important; }

.violations-badge {
    background: #dc3545;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

.violation-row {
    background: #fff5f5;
}

.violation-row:hover {
    background: #ffe8e8;
}

.violation-row code {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .form-row { flex-direction: column; }

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

    .actions { flex-wrap: wrap; }

    .data-table th,
    .data-table td { padding: 0.5rem 0.65rem; font-size: 0.8rem; }
}
