/* Profil-sida specifik styling */

/* Hero section för profil */
.profil-hero {
    background: linear-gradient(135deg, rgba(229,9,20,0.15), var(--bg-primary));
    padding: 120px 50px 40px;
    margin-top: 80px;
}

.profil-header {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Profilbild sektion */
.profil-bild-container {
    position: relative;
    flex-shrink: 0;
}

.profil-bild {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e50914, #ff6b35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
    border: 4px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.profil-bild:hover {
    transform: scale(1.05);
    border-color: var(--text-tertiary);
}

.profil-bild img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.bild-upload-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: #e50914;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid var(--bg-primary);
    font-size: 16px;
    transition: all 0.3s;
}

.bild-upload-overlay:hover {
    background: #ff6b35;
    transform: scale(1.1);
}

/* Profilinfo */
.profil-info {
    flex: 1;
}

.profil-namn {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profil-detaljer {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.profil-skola {
    font-size: 18px;
    color: #e50914;
    font-weight: 600;
    margin-bottom: 5px;
}

.profil-program {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.profil-stats {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

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

.stat-item-profil .stat-värde {
    color: #e50914;
    font-weight: 600;
}

/* Tab navigation */
.profil-tabs {
    max-width: 1200px;
    margin: 40px auto 0;
    border-bottom: 1px solid var(--border-color);
}

.tab-navigation {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}

.tab-button {
    padding: 15px 25px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
    font-size: 16px;
    font-weight: 500;
}

.tab-button:hover {
    color: var(--text-secondary);
}

.tab-button.active {
    color: #e50914;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #e50914, #ff6b35);
    border-radius: 2px 2px 0 0;
}

/* Tab content */
.profil-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 50px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Formulärsektioner */
.profil-sektion {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

body.light-mode .profil-sektion {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

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

.sektion-titel {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sektion-icon {
    font-size: 24px;
}

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

.redigera-knapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229,9,20,0.3);
}

/* Formulärfält */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-grupp {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s;
}

body.light-mode .form-input {
    background: rgba(255,255,255,0.9);
    border-color: rgba(0,0,0,0.08);
}

.form-input:focus {
    outline: none;
    border-color: #e50914;
    background: var(--glass-bg);
}

body.light-mode .form-input:focus {
    background: rgba(255,255,255,0.95);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Statistik cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card-profil {
    background: linear-gradient(135deg, rgba(229,9,20,0.1), rgba(255,107,53,0.1));
    border: 1px solid rgba(229,9,20,0.2);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

body.light-mode .stat-card-profil {
    background: linear-gradient(135deg, rgba(229,9,20,0.05), rgba(255,107,53,0.05));
    border: 1px solid rgba(229,9,20,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.stat-värde-stor {
    font-size: 32px;
    font-weight: 800;
    color: #e50914;
    margin-bottom: 8px;
}

.stat-beskrivning {
    font-size: 14px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

body.light-mode .achievement-card {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

body.light-mode .achievement-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.achievement-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e50914, #ff6b35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.achievement-info {
    flex: 1;
}

.achievement-namn {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.achievement-beskrivning {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.achievement-datum {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Toggle switches */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

body.light-mode .slider {
    background-color: rgba(0,0,0,0.15);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

body.light-mode .slider:before {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background: linear-gradient(135deg, #e50914, #ff6b35);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-primär, .btn-sekundär, .btn-fara {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primär {
    background: linear-gradient(135deg, #e50914, #ff6b35);
    color: white;
}

.btn-primär:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229,9,20,0.4);
}

.btn-sekundär {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

body.light-mode .btn-sekundär {
    background: rgba(255,255,255,0.8);
    border-color: rgba(0,0,0,0.08);
}

.btn-sekundär:hover {
    background: var(--glass-bg);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

body.light-mode .btn-sekundär:hover {
    background: rgba(255,255,255,0.95);
    border-color: rgba(0,0,0,0.12);
}

.btn-fara {
    background: rgba(231,76,60,0.1);
    color: #e74c3c;
    border: 2px solid rgba(231,76,60,0.2);
}

body.light-mode .btn-fara {
    background: rgba(231,76,60,0.05);
    border-color: rgba(231,76,60,0.15);
}

.btn-fara:hover {
    background: rgba(231,76,60,0.15);
    border-color: rgba(231,76,60,0.4);
}

body.light-mode .btn-fara:hover {
    background: rgba(231,76,60,0.1);
    border-color: rgba(231,76,60,0.3);
}

/* Mobile responsiv */
@media (max-width: 768px) {
    .profil-hero {
        padding: 100px 20px 30px;
    }
    
    .profil-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .profil-namn {
        font-size: 28px;
    }
    
    .profil-stats {
        justify-content: center;
    }
    
    .profil-content {
        padding: 30px 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .tab-navigation {
        justify-content: center;
    }
}

/* File upload dold input */
#profilBildInput {
    display: none;
}

/* Light mode notification styling */
body.light-mode .notification {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

body.light-mode .notification p {
    color: var(--text-secondary) !important;
}

/* Fortsätt titta grid */
.continue-watching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-card-small {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

body.light-mode .video-card-small {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.06);
}

.video-card-small:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

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

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

.progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0,0,0,0.5);
}

.progress-bar-small {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
}

.video-info-small {
    padding: 15px;
}

.video-title-small {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta-small {
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Redigera-knapp toggle */
#editPersonalInfo.editing {
    display: none;
}

#savePersonalInfo {
    display: none;
}

#savePersonalInfo.show {
    display: inline-flex;
}

/* =====================================================
   LOGOUT BUTTON I PROFIL HEADER
   ===================================================== */

.logout-btn-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    margin-top: 25px;
    margin-bottom: 30px;
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(255, 128, 0, 0.3);
    border-radius: 8px;
    color: #ff0a0a;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn-header:hover {
    background: rgba(229, 9, 20, 0.2);
    border-color: rgba(229, 9, 20, 0.5);
    transform: translateY(-2px);
}

.logout-btn-header:active {
    transform: translateY(0);
}

.logout-btn-header span {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .logout-btn-header {
        padding: 10px 20px;
        font-size: 13px;
        margin-top: 15px;
        margin-bottom: 20px;
    }
}

/* =====================================================
   MOBILE OVERLAY FIX FÖR PROFIL.HTML
   ===================================================== 
   Lägg till i SLUTET av profil.css
   ===================================================== */

/* Force full-screen overlay on mobile */
@media (max-width: 768px) {
    .mobile-menu-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        z-index: 9999 !important;
        display: none !important;
    }
    
    .mobile-menu-overlay.active {
        display: flex !important;
        opacity: 1 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mobile-menu-close {
        z-index: 10000 !important;
    }
    
    .mobile-menu-links {
        z-index: 10000 !important;
    }
}