/* GymFlix - Main Stylesheet */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables för tema */
:root {
    /* Dark mode colors (default) */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.8);
    --text-tertiary: rgba(255,255,255,0.6);
    --border-color: rgba(255,255,255,0.1);
    --card-bg: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    --glass-bg: rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.1);
    --shadow-color: rgba(0,0,0,0.3);
}

/* Light mode colors */
body.light-mode {
    --bg-primary: #fafafa;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #e8e8ed;
    --text-primary: #1d1d1f;
    --text-secondary: rgba(29,29,31,0.8);
    --text-tertiary: rgba(29,29,31,0.6);
    --border-color: rgba(0,0,0,0.08);
    --card-bg: linear-gradient(135deg, #ffffff, #f8f8fa);
    --glass-bg: rgba(255,255,255,0.8);
    --glass-border: rgba(0,0,0,0.06);
    --shadow-color: rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.category-card.english { 
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(15,15,15,0.95), rgba(15,15,15,0));
    padding: 15px 50px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
}

/* Light mode navbar */
body.light-mode .navbar {
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0));
}

body.light-mode .navbar.scrolled {
    background: rgba(255,255,255,0.98);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.navbar.scrolled {
    background: rgba(15,15,15,0.98);
    padding: 12px 50px;
    box-shadow: 0 2px 20px var(--shadow-color);
}

.logo {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #e50914, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 35px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

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

.profile-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar {
    padding: 12px 20px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--glass-bg);
    color: var(--text-primary);
    outline: none;
    width: 300px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-bar:focus {
    border-color: #e50914;
    background: var(--glass-bg);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 18px;
    z-index: 10;
    pointer-events: none; /* Inte klickbar på desktop */
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e50914, #ff6b35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
}

/* Tema-toggle knapp */
.theme-toggle {
    background: var(--glass-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    padding: 0;
}

.theme-toggle:hover {
    background: var(--glass-bg);
    border-color: var(--text-tertiary);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation för tema-byte */
@keyframes themeSwitch {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.theme-toggle.switching {
    animation: themeSwitch 0.5s ease;
}

/* Mobile anpassning */
@media (max-width: 768px) {
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Hero Section */
.hero {
    height: 80vh;
    background: linear-gradient(135deg, rgba(229,9,20,0.1), var(--bg-primary));
    display: flex;
    align-items: center;
    padding: 0 50px;
    position: relative;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(229,9,20,0.2);
    border: 1px solid rgba(229,9,20,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 20px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.hero p {
    font-size: 20px;
    margin-bottom: 35px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.hero-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-play {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #000;
    box-shadow: 0 4px 20px rgba(255,255,255,0.2);
}

body.light-mode .btn-play {
    background: linear-gradient(135deg, #000000, #333333);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255,255,255,0.3);
}

body.light-mode .btn-play:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.btn-info {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

/* Content Sections */
.content {
    padding: 60px 50px;
}

.section {
    margin-bottom: 60px;
}

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

.section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all {
    color: #e50914;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Subject Categories */
.subject-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.category-card {
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.category-card.math { 
    background: linear-gradient(135deg, #ff9a56, #ff6b95);
}
.category-card.science { 
    background: linear-gradient(135deg, #48c6ef, #6f86d6);
}
.category-card.history { 
    background: linear-gradient(135deg, #f093fb, #f5576c);
}
.category-card.language { 
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.category-card.religion { 
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.category-card.social-studies { 
    background: linear-gradient(135deg, #27ae60, #229954);
}

.category-card.philosophy { 
    background: linear-gradient(135deg, #6a5acd, #483d8b);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-count {
    font-size: 14px;
    opacity: 0.8;
}

/* Video Cards */
.video-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 15px 0 25px;
    scrollbar-width: none;
}

.video-row::-webkit-scrollbar {
    display: none;
}

.video-card {
    min-width: 320px;
    height: 180px;
    background: var(--card-bg);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.4s;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.video-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
}

.video-duration {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    color: white;
}

.video-difficulty {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-beginner {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.difficulty-intermediate {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.difficulty-advanced {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #000;
    opacity: 0;
    transition: all 0.3s;
}

body.light-mode .play-button {
    background: rgba(0,0,0,0.9);
    color: #fff;
}

.video-card:hover .play-button {
    opacity: 1;
}

.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 40px 20px 20px;
    color: white;
}

body.light-mode .video-info {
    background: linear-gradient(transparent, rgba(255,255,255,0.95));
    color: var(--text-primary);
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.video-description {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    opacity: 0.6;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #e50914;
    transition: width 0.3s;
}

/* Video Player Overlay */
.video-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
}

.video-player-overlay.show {
    display: flex;
    pointer-events: auto;
}

.video-player-container {
    width: 100%;
    max-width: 1200px;
    height: auto;
    max-height: 80vh;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: visible !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    pointer-events: auto;
}

.video-player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    padding: 15px 20px;
    z-index: 10001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.video-player-header > * {
    pointer-events: auto;
}

.video-player-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-right: 60px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.close-player {
    background: rgba(229,9,20,0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.close-player:hover {
    background: rgba(229,9,20,1);
    transform: scale(1.1);
}

/* Custom Plyr styles */
.plyr {
    border-radius: 0;
    position: relative;
    overflow: visible !important;
}

.plyr--video {
    background: #000;
}

.plyr__control--overlaid {
    background: linear-gradient(135deg, #e50914, #ff6b35);
    border: 3px solid rgba(255,255,255,0.3);
}

.plyr__control--overlaid:hover {
    background: linear-gradient(135deg, #ff6b35, #e50914);
}

.plyr__controls {
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    padding: 20px;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10003 !important;
    transform: translateY(0) !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.plyr__control {
    color: white;
    z-index: 10004 !important;
}

.plyr__control:hover {
    background: rgba(229,9,20,0.2);
}

.plyr__control.plyr__tab-focus {
    box-shadow: 0 0 0 3px rgba(229,9,20,0.5);
}

.plyr__progress__ring {
    color: #e50914;
}

.plyr__volume__display {
    color: white;
}

.plyr__progress {
    height: 8px;
    z-index: 10004 !important;
}

.plyr__progress input[type="range"] {
    height: 20px;
    cursor: pointer;
    z-index: 10004 !important;
}

.plyr__controls > * {
    z-index: 10004 !important;
}

.plyr__menu {
    z-index: 10005 !important;
}

.plyr__tooltip {
    z-index: 10005 !important;
}

/* Notifications and UI Elements */
.notification {
    position: fixed;
    top: 100px;
    right: 30px;
    background: var(--card-bg);
    border: 1px solid rgba(229,9,20,0.3);
    padding: 20px;
    border-radius: 15px;
    color: var(--text-primary);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}



/* Favoritknapp på videokort */
.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    backdrop-filter: blur(10px);
    z-index: 10;
    color: rgba(255,255,255,0.7);
}

body.light-mode .favorite-btn {
    background: rgba(255, 255, 255, 0.8);
    color: rgba(0,0,0,0.7);
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    color: #ffeb3b;
}

body.light-mode .favorite-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #ffeb3b;
}

.favorite-btn.favorited {
    background: rgba(229, 9, 20, 0.9);
    color: #ffeb3b;
}

.favorite-btn.favorited:hover {
    background: rgba(229, 9, 20, 1);
    color: #fff;
}

/* Justera existing video-card styling för att rymma favoritknappen */
.video-card {
    position: relative;
}

.video-duration {
    /* Flytta duration för att inte kollidera med favoritknappen */
    right: 54px; /* Istället för 10px */
}

/* Favoritknapp animation */
@keyframes favoriteAdded {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.favorite-btn.added {
    animation: favoriteAdded 0.3s ease;
}

/* Resume Dialog Styles */
.resume-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resume-dialog.show {
    opacity: 1;
    visibility: visible;
}

/* Resume dialog content */
.resume-content {
    background: var(--card-bg);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    margin: 20px;
    box-shadow: 0 20px 60px var(--shadow-color);
    transform: translateY(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resume-dialog.show .resume-content {
    transform: translateY(0);
}

/* Resume icon */
.resume-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #e50914;
}

/* Resume dialog text */
.resume-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.resume-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.resume-time {
    color: #e50914;
    font-weight: 600;
}

/* Resume buttons */
.resume-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.resume-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px;
}

/* Resume from start button */
.resume-from-start {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.resume-from-start:hover {
    background: var(--glass-bg);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

/* Resume continue button */
.resume-continue {
    background: linear-gradient(135deg, #e50914, #ff6b35);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2);
}

.resume-continue:hover {
    background: linear-gradient(135deg, #ff6b35, #e50914);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.3);
}

.resume-time-btn {
    font-weight: 700;
}

/* Enhanced progress bars for video cards */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 6px;
    background: #e50914;
    transition: all 0.3s ease;
    z-index: 5;
}

.progress-bar.completed {
    background: #2ecc71;
}

/* Progress percentage indicator */
.progress-indicator {
    position: absolute;
    bottom: 8px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
}

body.light-mode .progress-indicator {
    background: rgba(255, 255, 255, 0.8);
    color: black;
}

.video-card:hover .progress-indicator {
    opacity: 1;
}

/* Resume badge på videokort */
.resume-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(229, 9, 20, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.resume-badge::before {
    content: '⏸';
    font-size: 8px;
}

/* Video Sharing System CSS */
.share-button {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    backdrop-filter: blur(10px);
    z-index: 10;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transform: translateY(10px);
}

body.light-mode .share-button {
    background: rgba(255, 255, 255, 0.8);
    color: rgba(0, 0, 0, 0.7);
}

/* Visa delningsknappen vid hover på videokort - Universell CSS */
[data-video]:hover .share-button {
    opacity: 1;
    transform: translateY(0);
}

/* Specifika selektorer för bakåtkompatibilitet */
.video-card:hover .share-button,
.engelska-video-card:hover .share-button,
.svenska-video-card:hover .share-button,
.matematik-video-card:hover .share-button,
.historia-video-card:hover .share-button,
.naturkunskap-video-card:hover .share-button,
.religion-video-card:hover .share-button,
.samhallsvetenskap-video-card:hover .share-button,
.favorite-video-card:hover .share-button {
    opacity: 1;
    transform: translateY(0);
}

.share-button:hover {
    background: rgba(229, 9, 20, 0.9);
    color: white;
    transform: scale(1.1);
}

body.light-mode .share-button:hover {
    background: rgba(229, 9, 20, 0.9);
    color: white;
}

/* Delningsdialog */
.share-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10006;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-dialog.show {
    opacity: 1;
    visibility: visible;
}

/* Delningsdialogens innehåll */
.share-content {
    background: var(--card-bg);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 20px;
    padding: 0;
    text-align: left;
    max-width: 500px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 20px 60px var(--shadow-color);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.share-dialog.show .share-content {
    transform: translateY(0) scale(1);
}

/* Dialoghuvud */
.share-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.close-share {
    background: rgba(229, 9, 20, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-share:hover {
    background: rgba(229, 9, 20, 1);
    transform: scale(1.1);
}

/* Dialogkropp */
.share-body {
    padding: 20px 30px 30px;
}

.share-body p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* URL-container */
.share-url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    align-items: center;
}

.share-url {
    flex: 1;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.copy-url-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #e50914, #ff6b35);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-url-btn:hover {
    background: linear-gradient(135deg, #ff6b35, #e50914);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-option {
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.share-option:hover {
    background: var(--glass-bg);
    border-color: rgba(229, 9, 20, 0.5);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Specifika färger för sociala medier */
.share-option[data-method="whatsapp"]:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: #25d366;
}

.share-option[data-method="facebook"]:hover {
    background: rgba(24, 119, 242, 0.2);
    border-color: #1877f2;
}

.share-option[data-method="twitter"]:hover {
    background: rgba(29, 161, 242, 0.2);
    border-color: #1da1f2;
}

.share-option[data-method="email"]:hover {
    background: rgba(234, 67, 53, 0.2);
    border-color: #ea4335;
}

/* Mobile responsiv för resume dialog */
@media (max-width: 768px) {
    .resume-content {
        padding: 30px 20px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .resume-content h3 {
        font-size: 20px;
    }
    
    .resume-content p {
        font-size: 14px;
    }
    
    .resume-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .resume-btn {
        min-width: auto;
        width: 100%;
        padding: 12px 20px;
    }
    
    .resume-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .share-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
        bottom: 10px;
        left: 10px;
    }
    
    .share-content {
        width: 95%;
        margin: 10px;
        border-radius: 15px;
    }
    
    .share-header {
        padding: 20px 20px 15px;
    }
    
    .share-header h3 {
        font-size: 18px;
    }
    
    .close-share {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .share-body {
        padding: 15px 20px 25px;
    }
    
    .share-body p {
        font-size: 14px;
    }
    
    .share-url-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-url-btn {
        width: 100%;
        margin-top: 5px;
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
    
    /* För mobil - visa delningsknappen alltid på touch-enheter */
    @media (pointer: coarse) {
        .share-button {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Extra små skärmar */
@media (max-width: 480px) {
    .share-content {
        border-radius: 12px;
    }
    
    .share-header {
        padding: 15px 15px 12px;
    }
    
    .share-body {
        padding: 12px 15px 20px;
    }
    
    .share-url {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .copy-url-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .share-option {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Animation för delningsknappen */
@keyframes shareButtonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.share-button.copied {
    animation: shareButtonPulse 0.3s ease;
    background: rgba(46, 204, 113, 0.9) !important;
}

/* Hover-effekt för videokort med delningsknapp */
.video-card,
.engelska-video-card,
.svenska-video-card,
.matematik-video-card,
.historia-video-card,
.naturkunskap-video-card,
.religion-video-card,
.samhallsvetenskap-video-card,
.favorite-video-card {
    position: relative;
}

/* Förhindra att delningsknappen stör andra element */
.share-button {
    pointer-events: auto;
}

.video-thumbnail,
.engelska-video-thumbnail,
.svenska-video-thumbnail,
.matematik-video-thumbnail,
.historia-video-thumbnail,
.naturkunskap-video-thumbnail,
.religion-video-thumbnail,
.samhallsvetenskap-video-thumbnail,
.favorite-video-thumbnail {
    position: relative;
    overflow: visible;
}

/* Accessibility förbättringar */
.share-button:focus {
    outline: 2px solid #e50914;
    outline-offset: 2px;
}

.copy-url-btn:focus,
.share-option:focus,
.close-share:focus {
    outline: 2px solid #e50914;
    outline-offset: 2px;
}

/* Animation för resume dialog */
@keyframes resumeSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.resume-dialog.show .resume-content {
    animation: resumeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading state för videokort */
.video-card.loading .progress-bar {
    background: linear-gradient(90deg, 
        rgba(229, 9, 20, 0.3) 25%, 
        rgba(229, 9, 20, 0.8) 50%, 
        rgba(229, 9, 20, 0.3) 75%);
    background-size: 200% 100%;
    animation: progressLoading 1.5s infinite;
}

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

/* Mobile anpassning för favoritknapp */
@media (max-width: 768px) {
    .favorite-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        top: 10px;
        right: 10px;
    }
    
    .video-duration {
        right: 48px;
        font-size: 11px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    /* MOBIL: Expanderbar search */
    .search-container {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .search-bar {
        width: 0;
        padding: 0;
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border: none;
    }
    
    .search-container.active .search-bar {
        width: 150px;
        padding: 10px 15px 10px 40px;
        font-size: 13px;
        opacity: 1;
        pointer-events: all;
        border: 2px solid var(--border-color);
    }
    
    .search-icon {
        position: static; /* Alltid synlig */
        font-size: 18px;
        cursor: pointer;
        pointer-events: all !important; /* VIKTIGT: Måste kunna klickas */
        padding: 8px;
        border-radius: 50%;
        transition: all 0.3s ease;
        transform: none;
        left: auto;
        top: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 100; /* Ovanför allt annat */
        touch-action: manipulation; /* Bättre touch-support */
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    }
    
    .search-icon:active {
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* När search är öppen, flytta ikonen inuti */
    .search-container.active {
        position: relative;
    }
    
    .search-container.active .search-icon {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.05);
    }
    
    /* VIKTIGT: Visa theme-toggle på mobil! */
    .theme-toggle {
        display: flex !important;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .profile-section {
        display: flex;
        align-items: center;
        gap: 15px; /* Ökat från 10px till 15px */
    }
    
    .content {
        padding: 40px 20px;
    }
    
    .hero {
        padding: 0 20px;
        height: 70vh;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .video-card {
        min-width: 280px;
    }

    body.video-playing {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        touch-action: manipulation;
    }

    /* Video player mobile adjustments */
    .video-player-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 60px;
    }
    
    .video-player-container {
        width: 100%;
        max-width: none;
        height: auto;
        max-height: calc(100vh - 120px);
        border-radius: 4px;
    }
    
    .video-player-header {
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,0.9);
        backdrop-filter: blur(10px);
        z-index: 10002;
    }
    
    .video-player-title {
        font-size: 16px;
        margin-right: 50px;
    }
    
    .close-player {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Plyr mobile controls */
    .plyr {
        width: 100%;
        height: auto;
    }
    
    .plyr__controls {
        padding: 10px 15px;
        background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.4));
    }
    
    .plyr__control {
        min-width: 40px;
        min-height: 40px;
        font-size: 14px;
        margin: 0 2px;
    }
    
    .plyr__control--overlaid {
        width: 60px;
        height: 60px;
        border: 2px solid rgba(255,255,255,0.8);
    }
    
    .plyr__progress {
        height: 8px;
        margin: 10px 0;
    }
    
    .plyr__progress input[type="range"] {
        height: 20px;
        padding: 6px 0;
    }
    
    .plyr__time {
        font-size: 12px;
        padding: 0 5px;
    }
    
    .plyr__volume {
        display: none;
    }
    
    .plyr__control[data-plyr="pip"],
    .plyr__control[data-plyr="airplay"] {
        display: none;
    }
}

/* Mobile landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    .video-player-overlay {
        padding: 0;
        padding-top: 50px;
    }
    
    .video-player-container {
        max-height: calc(100vh - 50px);
        width: 100%;
        height: calc(100vh - 50px);
    }
    
    .video-player-header {
        padding: 8px 15px;
    }
    
    .video-player-title {
        font-size: 14px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .video-player-overlay {
        padding: 5px;
        padding-top: 55px;
    }
    
    .video-player-container {
        max-height: calc(100vh - 110px);
    }
    
    .plyr__controls {
        padding: 8px 10px;
    }
    
    .plyr__control {
        min-width: 36px;
        min-height: 36px;
        font-size: 12px;
        margin: 0 1px;
    }
    
    .plyr__time {
        font-size: 11px;
        padding: 0 3px;
    }
    
    .video-player-title {
        font-size: 14px;
        margin-right: 40px;
    }
}

/* Enhanced mobile Plyr controls */
@media (max-width: 768px) {
    .plyr__controls {
        padding: 15px;
    }
    
    .plyr__control {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .plyr__progress {
        height: 12px;
    }
    
    .plyr__progress input[type="range"] {
        height: 30px;
    }
    
    .plyr__volume {
        display: none;
    }
}

/* Prevent zoom on iOS */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}