/* WP LMS Plugin Frontend Styles */

/* Course Overview Styles */
.wp-lms-course-overview {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.course-content {
    margin-bottom: 40px;
}

.course-structure {
    background: #202020;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.course-structure h3 {
    margin-top: 0;
    color: #ECE7E7;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.chapters-list {
    margin-top: 20px;
}

.chapter-item {
    background: white;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chapter-item h4 {
    background: #007BFF;
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 16px;
}

.lessons-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lesson-item {
    background: #373636;
    padding: 12px 20px;
    border-bottom: 1px solid #737373;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-title {
    font-weight: 500;
    color: #cbcbcb;
}

.lesson-duration {
    color: #666;
    font-size: 14px;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Purchase Section */
.course-purchase {
    text-align: center;
    padding: 30px;
    background: #202020;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.wp-lms-purchase-section .course-price {
    font-size: 32px;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 20px;
}

.wp-lms-purchase-section .price {
    margin-right: 5px;
}

.wp-lms-purchase-section .currency {
    font-size: 18px;
    color: #666;
}

/* Buttons */
.wp-lms-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

.wp-lms-btn-primary {
    background: #007cba;
    color: white;
}

.wp-lms-btn-primary:hover {
    background: #005a87;
    color: white;
}

.wp-lms-btn-success {
    background: #46b450;
    color: white;
}

.wp-lms-btn-success:hover {
    background: #3a9640;
    color: white;
}

.wp-lms-btn-secondary {
    background: #666;
    color: white;
}

.wp-lms-btn-secondary:hover {
    background: #555;
    color: white;
}

/* Payment Form - Enhanced */
#wp-lms-payment-form {
    margin-top: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.payment-summary {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
}

.payment-summary h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.purchase-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.course-info {
    font-size: 16px;
    color: #333;
}

.version-info {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.price-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.total-label {
    font-weight: bold;
    color: #333;
}

.total-price {
    font-size: 20px;
    font-weight: bold;
    color: #007cba;
}

.payment-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.email-field,
.card-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-field label,
.card-field label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

#payment-email {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
}

#payment-email:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

#card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

#card-errors {
    color: #d32f2f;
    margin-bottom: 15px;
    font-size: 14px;
    padding: 10px;
    background: #fdf0f0;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    display: none;
}

#card-errors:not(:empty) {
    display: block;
}

.payment-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

#submit-payment {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;
}

#payment-amount {
    font-size: 14px;
    opacity: 0.8;
}

/* Disabled button styles */
.wp-lms-btn.disabled,
.wp-lms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #ccc !important;
    color: #666 !important;
}

.wp-lms-btn.disabled:hover,
.wp-lms-btn:disabled:hover {
    background: #ccc !important;
    color: #666 !important;
    transform: none;
}

#wp-lms-payment-status .success {
    color: #46b450;
    padding: 15px;
    background: #f0f8f0;
    border-radius: 6px;
    margin-top: 20px;
    border: 1px solid #c3e6c3;
}

#wp-lms-payment-status .error {
    color: #d32f2f;
    padding: 15px;
    background: #fdf0f0;
    border-radius: 6px;
    margin-top: 20px;
    border: 1px solid #f5c6cb;
}

/* Responsive payment form */
@media (max-width: 768px) {
    #wp-lms-payment-form {
        padding: 20px;
        margin-top: 20px;
    }
    
    .payment-summary {
        padding: 15px;
    }
    
    .payment-actions {
        flex-direction: column;
    }
    
    .payment-actions .wp-lms-btn {
        width: 100%;
    }
    
    .price-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .payment-summary h4 {
        font-size: 16px;
    }
    
    .total-price {
        font-size: 18px;
    }
    
    #submit-payment {
        min-width: auto;
    }
}

/* Learning Interface */
.wp-lms-learning-interface {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #202020;
    min-height: 100vh;
}

.learning-header {
    background: #202020;
    padding: 20px;
    border-bottom: 1px solid #303030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.learning-header h1 {
    margin: 0 0 15px 0;
    color: #c4c4c4;
    font-size: 24px;
}

.progress-bar-container {
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #46b450);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.learning-content {
    display: flex;
    height: calc(100vh - 120px);
}

.video-panel {
    flex: 1;
    background: white;
    position: relative;
    overflow: hidden;
}

.welcome-message {
    background: #202020;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: #c4c4c4;
}

.welcome-message h2 {
    color: #c4c4c4;
    margin-bottom: 10px;
}

#video-container {
    background: #202020;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#lesson-video {
    width: 100%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.code-sections {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.code-section-btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* Navigation Panel */
.navigation-panel {
    width: 350px;
    background: #202020;
    border-left: 1px solid #191919;
    overflow-y: auto;
}

.chapters-navigation {
    background: #202020;
    padding: 20px;
}

.chapter-nav {
    margin-bottom: 15px;
    border: 1px solid #202020;
    border-radius: 6px;
    overflow: hidden;
}

.chapter-header {
    background: #373737;
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: background 0.2s ease;
}

.chapter-header:hover {
    background: #323232;
}

.chapter-title {
    color: #c4c4c4;
}

.chapter-toggle {
    color: #666;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.lessons-nav {
    background: white;
    display: none; /* Initially hidden */
}

.lessons-nav.open {
    display: block;
}

.lesson-nav {
    background: #404040;
    padding: 12px 15px;
    border-bottom: 1px solid #202020;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.lesson-nav:hover {
    background: #464646;
}

.lesson-nav.active {
    background: #009FFF;
    border-left: 4px solid #007cba;
}

.lesson-nav:last-child {
    border-bottom: none;
}

.lesson-title {
    font-size: 14px;
    color: #cbcbcb;
    flex: 1;
}

.lesson-duration {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

.lesson-status {
    margin-left: 10px;
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

/* Overlay Panels */
.code-overlay, .wasm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-panel, .wasm-panel {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.code-header, .wasm-header {
    background: #333;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header h3, .wasm-header h3 {
    margin: 0;
    font-size: 18px;
    color: white !important;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.code-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.code-content pre {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.code-content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #333 !important;
    background: transparent !important;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* CSS-based Syntax Highlighting for Kotlin */
.code-content code.language-kotlin {
    /* Apply basic styling that works without JavaScript */
}

/* Simple regex-based highlighting using CSS pseudo-elements */
.code-content code::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Custom Syntax Highlighting Colors */
.code-content .token {
    background: none !important;
}

.code-content .token.comment {
    color: #708090 !important;
    font-style: italic;
}

.code-content .token.keyword {
    color: #0066cc !important;
    font-weight: bold;
}

.code-content .token.string {
    color: #009900 !important;
}

.code-content .token.number {
    color: #cc0000 !important;
}

.code-content .token.function {
    color: #cc6600 !important;
    font-weight: bold;
}

.code-content .token.class-name {
    color: #cc6600 !important;
    font-weight: bold;
}

.code-content .token.operator {
    color: #666666 !important;
}

.code-content .token.punctuation {
    color: #666666 !important;
}

.code-actions {
    text-align: center;
}

.wasm-content {
    width: 80vw;
    height: 70vh;
}

.wasm-content iframe {
    border: none;
    width: 100%;
    height: 100%;
}

/* Progress Widget */
.wp-lms-progress-widget {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

.progress-header h3 {
    margin: 0;
    color: #333;
}

.progress-percentage {
    font-size: 24px;
    font-weight: bold;
    color: #007cba;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.chapters-progress {
    margin-top: 20px;
}

.chapter-progress {
    margin-bottom: 20px;
}

.chapter-progress h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.lessons-progress {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.lesson-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.lesson-progress:last-child {
    border-bottom: none;
}

.lesson-progress.completed .lesson-title {
    color: #46b450;
}

.status-icon {
    font-size: 16px;
}

.status-icon.completed {
    color: #46b450;
}

.status-icon.in-progress {
    color: #ff9800;
}

.status-icon.not-started {
    color: #ccc;
}

/* User Courses */
.wp-lms-user-courses {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wp-lms-user-courses h3 {
    color: #333;
    margin-bottom: 20px;
}

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

.course-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.course-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-info {
    padding: 20px;
}

.course-info h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.course-progress {
    margin-bottom: 15px;
}

.progress-text {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    display: block;
}

.course-actions {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .learning-content {
        flex-direction: column;
        height: auto;
    }
    
    .navigation-panel {
        width: 100%;
        max-height: 300px;
        border-left: none;
        border-top: 1px solid #202020;
    }
    
    .code-panel, .wasm-panel {
        max-width: 95%;
        max-height: 95%;
    }
    
    .wasm-content {
        width: 90vw;
        height: 60vh;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .preview-modal-header {
        padding: 10px 15px;
    }
    
    .preview-modal-header h3 {
        font-size: 16px;
    }
    
    .preview-modal-footer {
        padding: 15px;
    }
}

/* Prevent duplicate preview buttons - AGGRESSIVE APPROACH */
/* Hide ALL preview buttons that are NOT in the course structure */
.wp-lms-preview-btn {
    display: none !important;
}

/* Only show preview buttons inside course structure */
.course-structure .wp-lms-preview-btn,
.course-structure .wp-lms-preview-btn-unique {
    display: inline-block !important;
}

/* Hide any buttons that might appear in content areas */
.course-content .wp-lms-preview-btn,
.entry-content .wp-lms-preview-btn,
.post-content .wp-lms-preview-btn,
.content .wp-lms-preview-btn,
article .wp-lms-preview-btn,
.entry .wp-lms-preview-btn {
    display: none !important;
}

/* Ensure our container has proper positioning */
.wp-lms-preview-container-unique {
    position: relative;
    z-index: 10;
}

/* Force visibility only in the right place */
.chapters-list .wp-lms-preview-btn,
.lessons-list .wp-lms-preview-btn,
.lesson-item .wp-lms-preview-btn {
    display: inline-block !important;
}

@media (max-width: 480px) {
    .wp-lms-course-overview,
    .wp-lms-user-courses {
        padding: 10px;
    }
    
    .course-structure {
        padding: 20px;
    }
    
    .learning-header {
        padding: 15px;
    }
    
    .learning-header h1 {
        font-size: 20px;
    }
    
    .chapters-navigation {
        padding: 15px;
    }
    
    .navigation-panel {
        max-height: 250px;
    }
}

/* Syntax Highlighting Support */
.code-content pre[class*="language-"] {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.code-content code[class*="language-"] {
    background: transparent;
}

/* Loading States */
.wp-lms-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.wp-lms-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.wp-lms-btn:focus,
.lesson-nav:focus,
.chapter-header:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Login Required Section */
.wp-lms-login-required {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
}

.wp-lms-login-required p {
    font-size: 16px;
    color: #495057;
    margin-bottom: 20px;
}

.wp-lms-auth-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.wp-lms-auth-links .wp-lms-btn {
    min-width: 120px;
}

/* Guest Purchase Section */
.wp-lms-guest-purchase-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

/* Guest Purchase Form - Dark Mode Compatible */
#wp-lms-guest-purchase-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#guest-payment-email {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white !important;
    color: #333 !important;
    width: 100%;
    box-sizing: border-box;
}

#guest-payment-email:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

#guest-card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white !important;
}

#guest-card-errors {
    color: #d32f2f;
    margin-bottom: 15px;
    font-size: 14px;
    padding: 10px;
    background: #fdf0f0;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    display: none;
}

#guest-card-errors:not(:empty) {
    display: block;
}

#wp-lms-guest-payment-status .success {
    color: #46b450;
    padding: 15px;
    background: #f0f8f0;
    border-radius: 6px;
    margin-top: 20px;
    border: 1px solid #c3e6c3;
}

#wp-lms-guest-payment-status .error {
    color: #d32f2f;
    padding: 15px;
    background: #fdf0f0;
    border-radius: 6px;
    margin-top: 20px;
    border: 1px solid #f5c6cb;
}

.wp-lms-guest-purchase-section .course-price {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 30px;
}

.purchase-options {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.guest-purchase-option {
    padding: 20px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.guest-purchase-option h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.guest-purchase-option p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.email-input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-input-section input[type="email"] {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

.email-input-section input[type="email"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.login-option {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-option p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

#wp-lms-guest-payment-form {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-top: 20px;
}

.payment-details {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.payment-details h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.customer-email {
    color: #666;
    font-size: 14px;
}

.payment-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .purchase-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .payment-actions {
        flex-direction: column;
    }
    
    .payment-actions .wp-lms-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wp-lms-auth-links {
        flex-direction: column;
        align-items: center;
    }
    
    .wp-lms-auth-links .wp-lms-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .wp-lms-guest-purchase-section {
        padding: 15px;
    }
    
    .wp-lms-guest-purchase-section .course-price {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .guest-purchase-option,
    .login-option {
        padding: 15px;
    }
}

/* Preview Functionality - CORRECTED Layout */
.lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #737373;
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.lesson-title {
    font-weight: 500;
    color: #cbcbcb;
    margin: 0;
    flex: 1;
}

.lesson-preview-action {
    margin: 0;
    flex-shrink: 0;
}

.lesson-duration-column {
    min-width: 60px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.lesson-duration {
    color: #666;
    font-size: 14px;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.wp-lms-preview-btn {
    padding: 6px 12px;
    font-size: 14px;
    min-width: auto;
}

/* Premium Purchase Options */
.wp-lms-premium-purchase-options {
    margin: 30px 0;
}

.wp-lms-premium-purchase-options h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.purchase-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.purchase-option {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.purchase-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.standard-option {
    border: 2px solid #e0e0e0;
}

.premium-option {
    border: 2px solid #ff9800;
    background: linear-gradient(135deg, #fff 0%, #fff8f0 100%);
}

.option-header {
    text-align: center;
    margin-bottom: 25px;
}

.option-header h4 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.premium-badge {
    background: #ff9800;
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.option-price {
    margin-bottom: 20px;
}

.option-price .price {
    font-size: 32px;
    font-weight: bold;
    color: #007cba;
}

.premium-option .option-price .price {
    color: #ff9800;
}

.option-price .currency {
    font-size: 18px;
    color: #666;
    margin-left: 5px;
}

.option-features {
    margin-bottom: 30px;
}

.option-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.option-features li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
    color: #555;
    font-size: 14px;
}

.option-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #46b450;
    font-weight: bold;
}

.premium-option .option-features li.premium-feature:before {
    color: #ff9800;
}

.option-action {
    text-align: center;
}

.wp-lms-btn-premium {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.wp-lms-btn-premium:hover {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

/* Standard Purchase (when no premium option) */
.wp-lms-standard-purchase {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.wp-lms-standard-purchase .course-price {
    font-size: 32px;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 20px;
}

.wp-lms-standard-purchase .price {
    margin-right: 5px;
}

.wp-lms-standard-purchase .currency {
    font-size: 18px;
    color: #666;
}

/* Responsive Design for Premium Options */
@media (max-width: 768px) {
    .purchase-options-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .purchase-option {
        padding: 20px;
    }
    
    .option-header h4 {
        font-size: 18px;
    }
    
    .option-price .price {
        font-size: 28px;
    }
    
    .wp-lms-premium-purchase-options h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .purchase-option {
        padding: 15px;
    }
    
    .option-header h4 {
        font-size: 16px;
        flex-direction: column;
        gap: 5px;
    }
    
    .option-price .price {
        font-size: 24px;
    }
    
    .option-features li {
        font-size: 13px;
    }
}

/* Preview Modal */
.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-modal {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.preview-modal-header {
    background: #333;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: white !important;
}

.preview-modal-content {
    padding: 0;
}

#preview-video {
    width: 100%;
    height: auto;
    max-height: 60vh;
    display: block;
}

.preview-modal-footer {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.preview-notice {
    margin: 0;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.preview-notice strong {
    color: #333;
}

@media (max-width: 768px) {
    .lesson-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lesson-main-content {
        width: 100%;
    }
    
    .lesson-duration-column {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
        padding-top: 0;
    }
    
    .lesson-preview-action {
        margin-top: 8px;
    }
    
    .preview-modal {
        max-width: 95%;
        max-height: 95%;
        width: auto;
    }
    
    #preview-video {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .lesson-preview-action {
        text-align: center;
    }
    
    .wp-lms-preview-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .lesson-duration-column {
        text-align: center;
        justify-content: center;
    }
    
    .preview-modal-header {
        padding: 10px 15px;
    }
    
    .preview-modal-header h3 {
        font-size: 16px;
    }
    
    .preview-modal-footer {
        padding: 15px;
    }
}
