/* PotionLMS Public Styles - Light Premium Theme */

:root {
    --potion-primary: #4f46e5;
    --potion-primary-hover: #4338ca;
    --potion-bg-light: #f9fafb;
    --potion-card-bg: #ffffff;
    --potion-text-main: #111827;
    --potion-text-muted: #6b7280;
    --potion-border: #e5e7eb;
}

/* Base resets for Potion LMS components */
.potion-lms-wrapper, 
.potion-lms-wrapper *,
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    color: var(--potion-text-main);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .potion-logo {
    font-family: 'Outfit', sans-serif !important;
}

input, select, textarea, button, a, p, span, li, div {
    font-family: 'Inter', sans-serif !important;
}
h1, h2, h3, h4, h5, h6, .potion-logo, .potion-step {
    font-family: 'Outfit', sans-serif !important;
}

/* Dashboard Styles */
.potion-dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--potion-border);
}

.potion-dashboard-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--potion-text-main);
}

.potion-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}

.potion-course-card {
    background: var(--potion-card-bg);
    border-radius: 12px;
    border: 1px solid var(--potion-border);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.potion-course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.potion-course-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e5e7eb;
}

.potion-course-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.potion-course-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.potion-course-content p {
    color: var(--potion-text-muted);
    font-size: 14px;
    flex-grow: 1;
}

.potion-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--potion-primary);
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.potion-btn:hover {
    background: var(--potion-primary-hover);
}

/* Lesson Player (Immersive Light Theme) */
.potion-lesson-player {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--potion-bg-light);
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999; /* Overlay on top of WP */
}

.potion-lesson-sidebar {
    width: 320px;
    background: var(--potion-card-bg);
    border-right: 1px solid var(--potion-border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.potion-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--potion-border);
}

.potion-sidebar-header h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
}
.potion-sidebar-header a {
    font-size: 13px;
    color: var(--potion-primary);
    text-decoration: none;
}

.potion-lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.potion-lesson-list li a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid var(--potion-border);
    text-decoration: none;
    color: var(--potion-text-main);
    transition: background 0.2s;
    font-size: 14px;
}

.potion-lesson-list li a:hover,
.potion-lesson-list li.active a {
    background: var(--potion-bg-light);
    color: var(--potion-primary);
    border-left: 4px solid var(--potion-primary);
}

.potion-lesson-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.potion-video-container {
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.potion-video-container iframe,
.potion-video-container video {
    width: 100%;
    height: 100%;
}

.potion-lesson-details {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.potion-lesson-details h1 {
    margin-top: 0;
    font-size: 32px;
}

/* ====================================================
   Single Course Details Page (Masteriyo Style)
   ==================================================== */

.potion-single-course-wrapper {
    background: #fdfdfd;
    color: #374151;
}

.potion-course-hero {
    background: linear-gradient(135deg, #1a1c29 0%, #2a2d43 100%);
    color: white;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.potion-hero-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    width: 100%;
    padding-right: 400px;
}

.potion-hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: #ffffff;
    line-height: 1.2;
    word-break: break-word;
}

.potion-hero-meta {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #d1d5db;
}

.potion-author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.potion-dot-separator {
    margin: 0 15px;
}

.potion-course-main-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    padding: 40px 20px;
    gap: 40px;
    position: relative;
}

.potion-course-left-column {
    flex: 1;
    max-width: 65%;
}

.potion-course-right-column {
    width: 350px;
    position: relative;
}

.potion-floating-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: sticky;
    top: -150px; /* Overlaps hero */
    margin-top: -180px;
    z-index: 10;
    border: 1px solid #f3f4f6;
    overflow: hidden;
}

.potion-card-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.potion-card-thumb-placeholder {
    width: 100%;
    height: 200px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.potion-card-body {
    padding: 25px;
}

.potion-card-price {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    text-align: center;
    margin-bottom: 20px;
}

.potion-btn-block {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border-radius: 8px;
    background: #6366f1;
}
.potion-btn-block:hover {
    background: #4f46e5;
}

.potion-card-includes {
    margin-top: 30px;
}
.potion-card-includes h4 {
    font-size: 14px;
    margin-bottom: 10px;
}
.potion-card-includes ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    color: #4b5563;
}
.potion-card-includes li {
    margin-bottom: 8px;
}

/* Sections */
.potion-section {
    margin-bottom: 50px;
}
.potion-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #111827;
}

.potion-what-you-learn {
    background: #f9fafb;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.potion-learn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.potion-learn-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.potion-learn-grid li {
    margin-bottom: 10px;
    font-size: 15px;
}

.potion-accordion-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    padding: 15px 20px;
}
.potion-accordion-header {
    display: flex;
    align-items: center;
}
.potion-lesson-number {
    font-weight: bold;
    color: #111827;
    margin-right: 15px;
}

.potion-instructor-card {
    border: 1px solid #e5e7eb;
    padding: 25px;
    border-radius: 8px;
}
.potion-instructor-flex {
    display: flex;
    align-items: center;
}
.potion-instructor-flex img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
}
.potion-instructor-flex h3 {
    margin: 0 0 5px 0;
}

/* Standalone Header (Shared across all pages) */
.potion-standalone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--potion-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    box-sizing: border-box;
    width: 100%;
}

.potion-standalone-header .potion-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.potion-standalone-header .potion-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--potion-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    line-height: 1.2;
}

.potion-standalone-header .potion-logo img {
    max-height: 36px;
    width: auto;
}

.potion-desktop-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.potion-back-home-btn {
    text-decoration: none; 
    color: #4b5563; 
    font-weight: 600; 
    font-size: 13px; 
    background: #f3f4f6; 
    padding: 7px 14px; 
    border-radius: 20px; 
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.potion-back-home-btn:hover { background: #e5e7eb; }

.potion-nav-link {
    text-decoration: none; 
    color: #4b5563; 
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
    white-space: nowrap;
}
.potion-nav-link:hover { color: var(--potion-primary); }

.potion-cart-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.2s;
}
.potion-cart-badge-link:hover { color: var(--potion-primary); }

.potion-badge {
    background: var(--potion-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
}

.potion-btn-header-cta {
    background: var(--potion-primary); 
    color: #ffffff !important; 
    padding: 8px 18px; 
    border-radius: 20px; 
    text-decoration: none; 
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}
.potion-btn-header-cta:hover { background: var(--potion-primary-hover); }

/* Mobile Actions (Hidden on Desktop) */
.potion-mobile-actions {
    display: none;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.potion-mobile-cart-icon {
    position: relative;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    text-decoration: none;
}
.potion-mobile-cart-icon .potion-badge-dot {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.potion-mobile-panel-pill {
    background: var(--potion-primary);
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
}

.potion-mobile-menu-btn {
    background: #f3f4f6;
    border: none;
    color: #1f2937;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}
.potion-mobile-menu-btn:hover,
.potion-mobile-menu-btn:active {
    background: #e5e7eb;
}

/* Mobile Nav Drawer */
.potion-nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.potion-nav-backdrop.active {
    opacity: 1;
}

.potion-mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 82%;
    max-width: 320px;
    height: 100%;
    background: #ffffff;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}
.potion-mobile-nav-drawer.active {
    transform: translateX(0);
}

.potion-mobile-nav-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--potion-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.potion-mobile-nav-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: #111827;
}
.potion-mobile-nav-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.potion-mobile-nav-list {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}
.potion-mobile-nav-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s, color 0.2s;
}
.potion-mobile-nav-list li a:hover,
.potion-mobile-nav-list li a:active {
    background: #f8fafc;
    color: var(--potion-primary);
}
.potion-nav-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 8px 20px;
}
.potion-highlight-item {
    background: #eef2ff !important;
    color: var(--potion-primary) !important;
    font-weight: 700 !important;
}

/* Mobile Sticky Buy Bar */
.potion-mobile-buy-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 18px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 999;
    border-top: 1px solid var(--potion-border);
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    gap: 12px;
}

.potion-mobile-buy-bar .price { 
    font-size: 20px; 
    font-weight: 800; 
    color: var(--potion-text-main); 
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

.potion-mobile-buy-bar .price small {
    display: block;
    font-size: 11px;
    color: var(--potion-text-muted);
    font-weight: normal;
}

.potion-mobile-buy-bar .btn { 
    background: var(--potion-primary); 
    color: #ffffff !important; 
    padding: 12px 20px; 
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 700; 
    font-size: 15px;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    white-space: nowrap;
}

.potion-mobile-buy-bar .btn:hover,
.potion-mobile-buy-bar .btn:active {
    background: var(--potion-primary-hover);
    transform: translateY(-1px);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .potion-hero-container {
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .potion-standalone-header {
        padding: 10px 14px;
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .potion-desktop-nav {
        display: none !important;
    }
    
    .potion-mobile-actions {
        display: flex !important;
    }
    
    .potion-nav-backdrop {
        display: block;
        pointer-events: none;
    }
    .potion-nav-backdrop.active {
        pointer-events: auto;
    }
    
    .potion-standalone-header .potion-logo {
        font-size: 16px;
        max-width: calc(100vw - 140px);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .potion-standalone-header .potion-logo img {
        max-height: 30px;
    }
    
    .potion-course-hero {
        padding: 40px 16px;
    }

    .potion-hero-content h1 {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .potion-course-main-layout { 
        flex-direction: column; 
        padding: 24px 16px;
        gap: 24px;
    }
    
    .potion-course-left-column, 
    .potion-course-right-column { 
        max-width: 100%; 
        width: 100%; 
    }
    
    .potion-floating-card { 
        position: relative; 
        margin-top: 10px; 
        top: 0; 
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    }
    
    .potion-learn-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .potion-hero-container { 
        padding-right: 0; 
        width: 100%; 
    }
    
    .potion-mobile-buy-bar { 
        display: flex; 
    }
    
    body.has-potion-buy-bar { 
        padding-bottom: 80px; 
    }
}

@media (max-width: 480px) {
    .potion-standalone-header {
        padding: 10px 12px;
    }
    
    .potion-course-content h3 {
        font-size: 16px;
    }
    
    .potion-course-thumb {
        height: 160px;
    }
}
