/* ============================================
   EtD-TV Python - Clean Minimal CSS
   ============================================ */

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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-card: #181818;
    --text-primary: #ffffff;
    --text-secondary: #a7a7a7;
    --accent: #e50914;
    --accent-hover: #ff1f2d;
    --border: #282828;
    --radius: 8px;
    --transition: 0.2s ease;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border: #e0e0e0;
}

body {
    font-family: 'Poppins', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo img {
    display: block;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.main-nav a:hover {
    color: var(--text-primary);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: inline; }
[data-theme="light"] .theme-toggle .sun { display: inline; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* User Dropdown Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.user-menu-btn:hover {
    border-color: var(--text-secondary);
}

.user-menu-btn svg {
    transition: transform var(--transition);
}

.user-menu.open .user-menu-btn svg {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: 1000;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition);
    text-align: left;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--bg-secondary);
}

.user-dropdown a:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.user-dropdown .logout-link {
    color: #e74c3c;
    border-radius: 0 0 var(--radius) var(--radius);
}

.user-dropdown .logout-link:hover {
    background: rgba(231, 76, 60, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.dropdown-theme {
    font-family: inherit;
}

.dropdown-theme .sun-icon { display: none; }
.dropdown-theme .moon-icon { display: inline; }
[data-theme="dark"] .dropdown-theme .sun-icon { display: inline; }
[data-theme="dark"] .dropdown-theme .moon-icon { display: none; }
[data-theme="light"] .dropdown-theme .sun-icon { display: none; }
[data-theme="light"] .dropdown-theme .moon-icon { display: inline; }

[data-theme="dark"] .dropdown-theme .theme-label::after { content: "Lys modus"; }
[data-theme="light"] .dropdown-theme .theme-label::after { content: "Mørk modus"; }
.dropdown-theme .theme-label { font-size: 0; }

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

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Login CTA Animation */
.btn-login-cta {
    animation: pulse-glow 2s ease-in-out infinite;
    position: relative;
}

.btn-login-cta:hover {
    animation: none;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(229, 9, 20, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(229, 9, 20, 0.8), 0 0 30px rgba(229, 9, 20, 0.4);
    }
}

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

.btn-secondary:hover {
    background: var(--bg-secondary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.site-main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* ============================================
   VIDEO GRID
   ============================================ */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.video-card a {
    text-decoration: none;
    color: inherit;
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

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

.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.video-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   VIDEO PLAYER PAGE
   ============================================ */

.video-player-wrapper {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.video-player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-details {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    margin-bottom: 2rem;
}

.video-details h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.video-details .meta {
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================
   FORMS
   ============================================ */

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
}

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

.auth-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.auth-form h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ============================================
   MY PAGE
   ============================================ */

.section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.video-list-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.video-list-item img {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 0.5rem;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-about p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-broadcast {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-broadcast p {
    margin-bottom: 0.25rem;
}

.footer-broadcast a {
    color: var(--accent);
    text-decoration: none;
}

.footer-broadcast a:hover {
    text-decoration: underline;
}

.footer-links nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-support .support-item {
    margin-bottom: 0.75rem;
}

.footer-support .support-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-support .support-num {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-contact .contact-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.footer-contact .contact-link:hover {
    text-decoration: underline;
}

.footer-contact .facebook-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-contact .org-info {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.footer-heart .heart {
    color: var(--accent);
}

/* ============================================
   AUTH MODAL
   ============================================ */

.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.auth-modal.open {
    display: flex;
}

.auth-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    margin: 1rem;
    animation: modalSlideIn 0.3s ease;
}

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

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color var(--transition);
}

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

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-logo span {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-tab:hover:not(.active) {
    color: var(--text-primary);
}

.auth-greeting {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.auth-form-container .form-group {
    margin-bottom: 1rem;
}

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

.auth-form-container .form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color var(--transition);
}

.auth-form-container .form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.auth-form-container .form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.forgot-link {
    color: var(--accent);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.auth-error {
    color: #ff6b6b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.auth-error.show {
    display: block;
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

.auth-terms {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.auth-terms a {
    color: var(--accent);
    text-decoration: none;
}

.auth-terms a:hover {
    text-decoration: underline;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.auth-success {
    color: #4ade80;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.auth-success.show {
    display: block;
}

.auth-back {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-back a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-back a:hover {
    color: var(--text-primary);
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.flash.error {
    background: #4a1515;
    color: #ff8080;
}

.flash.success {
    background: #154a15;
    color: #80ff80;
}

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

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .header-actions .user-name {
        display: none;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .video-details {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .footer-links nav {
        align-items: center;
    }

    .footer-contact .contact-link {
        display: block;
    }

    .footer-contact .facebook-link {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Mobile navigation menu */
    .main-nav.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
        gap: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .main-nav.mobile-open a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }

    .main-nav.mobile-open a:last-child {
        border-bottom: none;
    }

    /* Adjust header for mobile menu */
    .site-header {
        position: relative;
    }

    /* Login button on mobile */
    .btn-login-cta {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Video list items on mobile */
    .video-list-item {
        flex-direction: column;
    }

    .video-list-item img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    /* Auth modal on mobile */
    .auth-modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-about {
        grid-column: 1 / -1;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small phones */
@media (max-width: 480px) {
    .header-container {
        padding: 0.5rem 1rem;
        gap: 1rem;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    .site-main {
        padding: 1rem;
    }

    .video-player-wrapper {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }

    .video-details h1 {
        font-size: 1.25rem;
    }

    .footer-container {
        padding: 2rem 1rem 1rem;
    }

    .user-menu-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .user-menu-btn span {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
