/* Font Declarations */
@font-face {
    font-family: 'Manrope';
    src: url('fonts/Manrope-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('fonts/Manrope-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Frontend Styles for Course Management Plugin */

/* Global Styles with Manrope Font */
body {
    background-color: #f8f9fa !important;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-weight: 400; /* Regular for body text */
}

.course-list-container,
.course-dashboard-container,
.course-viewer-container {
    background-color: #f8f9fa;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
}

/* TITLES - Medium Weight (500) */
h1, h2, h3, h4, h5, h6,
.course-title,
.lesson-title,
.dashboard-header h1,
.course-header h1,
.week-title,
.section-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

/* PARAGRAPHS - Regular Weight (400) */
p, span, div, 
.course-description,
.course-excerpt,
.lesson-description,
.course-meta,
.progress-text,
.subtitle {
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
}

/* Common Button Styles - Medium Weight (500) */
.button {
    display: inline-block;
    padding: 12px 24px;
    background: #3B82F6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 500; /* Medium for buttons */
    transition: all 0.3s ease;
    border: 2px solid #3B82F6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.2);
}

.button:hover {
    background: #1e5b8c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.3);
}

.button-primary {
    background: #3B82F6;
    border-color: #3B82F6;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

.button-secondary {
    background: #ffffff;
    color: #3B82F6;
    border: 2px solid #3B82F6;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

.button-secondary:hover {
    background: #3B82F6;
    color: white;
}

.button-outline {
    background: transparent;
    color: #3B82F6;
    border: 2px solid #3B82F6;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

.button-outline:hover {
    background: #3B82F6;
    color: white;
}

.button-disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

.button-disabled:hover {
    background: #ccc !important;
    transform: none !important;
}

/* Common Progress Bar Styles */
.progress-bar {
    background: #f6f7f7;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a085, #3498db);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #646970;
    font-weight: 500;
}

/* Common Meta Styles */
.difficulty {
    color: white;
}

.difficulty-beginner {
    background: #3B82F6;
    color: white!important;
}

.difficulty-intermediate {
    background: #3B82F6;
    color: white!important;
}

.difficulty-advanced {
    background: #3B82F6;
    color: white!important;
}

/* Course List Specific Styles moved to course-list.css */
/* My Courses Dashboard Specific Styles moved to my-courses.css */
/* Course Viewer Specific Styles moved to course-viewer.css */
/* Lesson Viewer Specific Styles are in lesson-viewer.css */

/* Video Container Styles - Shared across lesson and course viewers */
.video-container {
    position: relative;
    width: 100%;
    margin: 0 auto 30px auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-container iframe,
.video-container video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

/* Global Plyr Customizations */
.plyr {
    --plyr-color-main: #3B82F6;
    --plyr-video-background: #000;
    --plyr-menu-background: rgba(255, 255, 255, 0.9);
    --plyr-menu-color: #000;
}

.plyr--full-ui input[type="range"] {
    color: #3B82F6;
}

.plyr__control.plyr__tab-focus,
.plyr__control:hover,
.plyr__control[aria-expanded="true"] {
    background: rgba(59, 130, 246, 0.8);
}

/* Hide YouTube branding and prevent navigation */
.plyr--youtube .plyr__video-embed iframe {
    pointer-events: none !important; /* Prevent clicks on YouTube iframe */
}

.plyr--youtube .plyr__video-embed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

/* Hide YouTube watermark and branding elements */
.plyr--youtube .ytp-watermark,
.plyr--youtube .ytp-chrome-top-buttons,
.plyr--youtube .ytp-show-cards-title,
.plyr--youtube .ytp-pause-overlay,
.plyr--youtube .ytp-impression-link {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure Plyr controls are on top */
.plyr--youtube .plyr__controls {
    z-index: 10 !important;
    pointer-events: auto !important;
}

/* Hide Vimeo branding elements */
.plyr--vimeo .plyr__video-embed iframe {
    pointer-events: none !important;
}

.plyr--vimeo .plyr__controls {
    z-index: 10 !important;
    pointer-events: auto !important;
}

.video-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    z-index: 2;
    /* Prevent layout violations */
    will-change: opacity;
    transform: translateZ(0);
}

/* Video placeholder optimizations */
.video-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    /* Hardware acceleration to prevent violations */
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: opacity 0.3s ease;
}

/* Optimize video containers for performance */
.video-container {
    /* Enable hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Prevent layout shifts */
    contain: layout style;
}

/* Video.js Player Customizations */
.video-js {
    border-radius: 8px;
    overflow: hidden;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
}

.video-js .vjs-big-play-button {
    background: rgba(59, 130, 246, 0.9);
    border: none;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.video-js .vjs-big-play-button:hover {
    background: rgba(59, 130, 246, 1);
    transform: scale(1.1);
}

.video-js .vjs-control-bar {
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    border-radius: 0 0 8px 8px;
}

.video-js .vjs-progress-control .vjs-progress-holder {
    border-radius: 2px;
}

.video-js .vjs-progress-control .vjs-play-progress {
    background: #3B82F6;
    border-radius: 2px;
}

/* Video.js responsive */
.video-js.vjs-fluid {
    width: 100%;
    max-width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-js.vjs-fluid .vjs-tech {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Common Loading and Animations */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

/* Print Styles */
@media print {
    .course-progress-overlay,
    .course-actions,
    .lesson-actions,
    .course-navigation {
        display: none;
    }

    .course-card,
    .lesson-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Common responsive utilities */
@media screen and (max-width: 768px) {
    .course-dashboard-container,
    .course-viewer-container,
    .course-list-container {
        padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    .button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* ================================
   PURCHASE BUTTON STYLES
   ================================ */

.hayc-purchase-container {
    margin: 20px 0;
    text-align: center;
}

.hayc-purchase-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.hayc-price {
    font-size: 2em;
    font-weight: 500;
    color: #2c5aa0;
    margin-bottom: 10px;
    font-family: 'Manrope', sans-serif;
}

.hayc-buy-button {
    background: black;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
    min-width: 200px;
}

.hayc-buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.hayc-buy-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hayc-loading {
    color: #666;
    font-style: italic;
    margin-top: 10px;
    font-family: 'Manrope', sans-serif;
}

.hayc-login-required {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    font-family: 'Manrope', sans-serif;
}

.hayc-auth-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.hayc-login-btn, .hayc-register-btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-family: 'Manrope', sans-serif;
    transition: all 0.3s ease;
}

.hayc-login-btn {
    background: #007cba;
    color: white;
}

.hayc-login-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.hayc-register-btn {
    background: #00a32a;
    color: white;
}

.hayc-register-btn:hover {
    background: #007a1f;
    color: white;
    text-decoration: none;
}

.hayc-enrolled, .hayc-purchased {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-family: 'Manrope', sans-serif;
}

.hayc-enrolled a {
    color: #0c5460;
    font-weight: 500;
    text-decoration: underline;
}

.hayc-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-family: 'Manrope', sans-serif;
}

/* Purchase Button Responsive Design */
@media (max-width: 768px) {
    .hayc-auth-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hayc-login-btn, .hayc-register-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .hayc-buy-button {
        width: 100%;
        max-width: 250px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .hayc-price {
        font-size: 1.5em;
    }
}

/* ================================
   PURCHASE MODAL STYLES
   ================================ */

/* Modal Background */
.hayc-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 12px 16px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

/* Modal Content */
.hayc-modal-content {
    background-color: white;
    margin: 16px auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    font-family: 'Manrope', sans-serif;
    /* Inherit from dark themes would otherwise leave body text white on this white panel */
    color: #1a1a1a;
}

/* Modal Header */
.hayc-modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hayc-modal-header h3 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    color: #2c5aa0;
    font-size: 1.4em;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hayc-modal-close {
    flex-shrink: 0;
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.hayc-modal-close:hover {
    color: #666;
}

/* Modal Body */
.hayc-modal-body {
    padding: 25px 30px 30px;
}

.hayc-course-info {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.hayc-course-info h4 {
    margin: 0 0 10px;
    color: #333;
    font-size: 1.1em;
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hayc-modal-price {
    font-size: 2em;
    font-weight: 600;
    color: #2c5aa0;
    margin: 10px 0;
}

/* Quick Purchase Form */
.hayc-quick-purchase {
    margin-bottom: 25px;
}

.hayc-quick-purchase h4 {
    margin: 0 0 8px;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
}

.hayc-quick-purchase p {
    margin: 0 0 15px;
    color: #666;
    font-size: 0.9em;
}

/* Free-course guest modal uses this class; keep same contrast as .hayc-quick-purchase */
.hayc-quick-enrollment {
    margin-bottom: 25px;
}

.hayc-quick-enrollment h4 {
    margin: 0 0 8px;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
}

.hayc-quick-enrollment p {
    margin: 0 0 15px;
    color: #666;
    font-size: 0.9em;
}

.hayc-quick-enrollment p small {
    color: #666;
}

.hayc-guest-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hayc-guest-form input {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Manrope', sans-serif;
    transition: border-color 0.3s ease;
}

.hayc-guest-form input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.hayc-guest-form button {
    margin-top: 8px;
}

/* Name row for first/last name */
.hayc-name-row {
    display: flex;
    gap: 10px;
}

.hayc-name-row input {
    flex: 1;
    width: 50%;
}

/* Divider */
.hayc-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.hayc-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
}

.hayc-divider span {
    background: white;
    padding: 0 15px;
    color: #999;
    font-size: 0.9em;
    font-weight: 500;
}

/* Login Option */
.hayc-login-option {
    text-align: center;
}

.hayc-login-option p {
    margin: 0 0 12px;
    color: #555;
    font-size: 0.9em;
}

.hayc-modal-content .hayc-login-option a.hayc-login-btn {
    display: inline-block;
    color: #fff;
}

/* Free Course Styling */
.hayc-price.hayc-free {
    background: green;
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 7px;
    display: inline-block;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.hayc-modal-price.hayc-free {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 25px;
    display: inline-block;
    font-size: 1.2em;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Prevent body scroll when modal is open */
body.hayc-modal-open {
    overflow: hidden;
}

/* Modal Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hayc-modal {
        padding: 10px 12px;
    }

    .hayc-modal-content {
        margin: 12px auto;
        width: 95%;
        max-width: none;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }
    
    .hayc-modal-header,
    .hayc-modal-body {
        padding: 20px;
    }
    
    .hayc-modal-price {
        font-size: 1.8em;
    }

    .hayc-name-row {
        flex-direction: column;
    }

    .hayc-name-row input {
        width: 100%;
    }
}

/* ================================
   ENHANCED YOUTUBE PROTECTION
   ================================ */

/* Immediate CSS-based YouTube protection */
.video-container {
    position: relative !important;
}

/* SIMPLE CLICK BLOCKING ZONES */

/* Block top 50px - prevents logo, title, share clicks */
.video-container .block-top {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 70px !important;
    background: transparent !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    cursor: not-allowed !important;
}

/* Block bottom 40px - prevents info/link clicks */
.video-container .block-bottom {
    position: absolute !important;
    bottom: 0 !important;
    left: 450px !important;
    width: 50% !important;
    height: 38px !important;
    background: transparent !important;
    z-index: 9998 !important;
    pointer-events: auto !important;
    cursor: not-allowed !important;
}

/* Block left 50px - prevents YouTube text clicks */
.video-container .block-left {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 50px !important;
    height: 16% !important;
    background: transparent !important;
    z-index: 9998 !important;
    pointer-events: auto !important;
    cursor: not-allowed !important;
}

/* Visual indicator in top-left */
.video-container .protection-badge {
    position: absolute !important;
    top: 10px !important;
    left: 60px !important;
    width: 80px !important;
    height: 25px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    font-size: 8px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    border-radius: 3px !important;
    pointer-events: none !important;
    font-family: Arial, sans-serif !important;
}

/* Clean iframe styling with right-click protection */
.video-container iframe {
    border: none !important;
    box-sizing: border-box !important;
}

/* Disable right-click on entire video area */
.video-container {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Remove right-click blocker overlay - using direct event blocking instead */