/**
 * Exam Content Generator Pro - Frontend Styles
 */

/* ================================
   EXAM OVERVIEW
   ================================ */
.ecg-exam-overview {
    max-width: 100%;
    line-height: 1.8;
}

.ecg-exam-overview h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #1a1a1a;
}

.ecg-exam-overview h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #333;
}

.ecg-exam-overview table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.ecg-exam-overview th,
.ecg-exam-overview td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.ecg-exam-overview th {
    background: #f5f5f5;
    font-weight: 600;
}

/* ================================
   STUDY NOTES
   ================================ */
.ecg-study-notes {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
}

.ecg-study-notes h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 32px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.ecg-study-notes h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 28px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    line-height: 1.3;
}

.ecg-study-notes h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-top: 24px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.ecg-study-notes h4 {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin-top: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.ecg-study-notes h1:first-child,
.ecg-study-notes h2:first-child,
.ecg-study-notes h3:first-child {
    margin-top: 0;
}

.ecg-study-notes p {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.8;
}

.ecg-study-notes ul,
.ecg-study-notes ol {
    margin: 18px 0;
    padding-left: 28px;
}

.ecg-study-notes li {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.7;
}

.ecg-study-notes strong {
    font-weight: 600;
    color: #1e293b;
}

.ecg-study-notes a {
    color: #0b415d;
    text-decoration: underline;
}

.ecg-study-notes a:hover {
    color: #1a5a7a;
}

.ecg-study-notes blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: #f8fafc;
    border-left: 4px solid #CBA557;
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    font-style: italic;
    color: #475569;
}

.ecg-study-notes table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.ecg-study-notes th,
.ecg-study-notes td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.ecg-study-notes th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.ecg-study-notes code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-family: Consolas, Monaco, monospace;
}

/* Study Chapter */
.ecg-study-notes .study-chapter {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ecg-study-notes .chapter-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    margin: 0;
    padding: 20px 25px;
    font-size: 22px;
}

.ecg-study-notes .chapter-content {
    padding: 25px;
    line-height: 1.8;
    font-size: 16px;
}

.ecg-study-notes .chapter-content h3 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* Key Concept Box */
.ecg-study-notes .key-concept {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 100%);
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

/* Exam Tip Box */
.ecg-study-notes .exam-tip {
    background: linear-gradient(135deg, #fef9e7 0%, #fffbf0 100%);
    border-left: 4px solid #f1c40f;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.ecg-study-notes .exam-tip::before {
    content: "💡 Exam Tip: ";
    font-weight: 700;
    color: #d4ac0d;
}

/* Definition Box */
.ecg-study-notes .definition {
    background: linear-gradient(135deg, #eafaf1 0%, #f0fff4 100%);
    border-left: 4px solid #27ae60;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

/* Study Notes word-lock (first N words visible, remainder blurred) */
.ecg-study-notes-wordlock .ecg-sn-preview {
    position: relative;
}

.ecg-study-notes-wordlock .ecg-sn-blur {
    position: relative;
    overflow: hidden;
    max-height: 168px;
    border-radius: 12px;
    /* Prevent text selection and copying */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.ecg-study-notes-wordlock .ecg-sn-blur-inner {
    filter: blur(5px);
    /* Prevent text selection on inner content too */
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* Clean blur overlay for the locked section - no grey gradient */
.ecg-study-notes-wordlock .ecg-sn-blur::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: transparent;
    z-index: 5;
}

@media (max-width: 600px) {
    .ecg-study-notes-wordlock .ecg-sn-blur {
        max-height: 126px;
    }
}

/* ================================
   FLASH CARDS
   ================================ */
.ecg-flash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.ecg-flash-cards.ecg-teaser .ecg-teaser-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.flash-card {
    perspective: 1000px;
    height: 250px;
    cursor: pointer;
}

.flash-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.flash-card:hover .flash-card-inner {
    transform: rotateY(180deg);
}

.flash-card.flipped .flash-card-inner {
    transform: rotateY(180deg);
}

.flash-card-front,
.flash-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    box-sizing: border-box;
    text-align: center;
}

.flash-card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.flash-card-back {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    transform: rotateY(180deg);
}

.flash-card .card-number {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255,255,255,0.2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.flash-card .question {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    font-weight: 500;
}

.flash-card .answer {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* ================================
   TEASER / FOMO OVERLAY
   ================================ */
.ecg-teaser {
    position: relative;
}

.ecg-teaser .ecg-teaser-content {
    position: relative;
}

.ecg-teaser .ecg-teaser-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent 0%, #fff 100%);
    pointer-events: none;
}

/* Study notes wordlock: disable the fade gradient, use pure blur instead */
.ecg-study-notes-wordlock.ecg-teaser .ecg-teaser-content::after {
    display: none;
}

.ecg-teaser-overlay {
    background-color: #0f172a;
    background-image: radial-gradient(rgba(255,255,255,0.16) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    margin-top: 30px;
    color: #ffffff;
}

/* Remove promo badge (legacy/cached CSS safety) */
.ecg-teaser-overlay::before { content: none !important; display: none !important; }

.ecg-teaser-message {
    max-width: 500px;
    margin: 0 auto;
}

.ecg-lock-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ecg-teaser-message h3 {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 15px;
}

.ecg-teaser-message p {
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.ecg-upgrade-btn {
    display: inline-block;
    background-color: #CBA557;
    color: #0b415d !important;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s;
    box-shadow: 0 6px 18px rgba(203, 165, 87, 0.25);
}

.ecg-upgrade-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(203, 165, 87, 0.35);
}



/* ================================
   NOTICE MESSAGES
   ================================ */
.ecg-notice {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .ecg-flash-cards {
        grid-template-columns: 1fr;
    }
    
    .flash-card {
        height: 220px;
    }
    
    .ecg-teaser-message h3 {
        font-size: 20px;
    }
    
    .ecg-upgrade-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .ecg-study-notes .chapter-title {
        font-size: 18px;
        padding: 15px 20px;
    }
}

/* ================================
   DARK MODE SUPPORT
   ================================ */
@media (prefers-color-scheme: dark) {
    .ecg-teaser-overlay {
        background-color: #0f172a;
        border-color: rgba(255,255,255,0.10);
    }
    
    .ecg-teaser .ecg-teaser-content::after {
        background: linear-gradient(to bottom, transparent 0%, #1a1a1a 100%);
    }
    
    .ecg-teaser-message h3 {
        color: #fff;
    }
    
    .ecg-teaser-message p {
        color: #cbd5e1;
    }
}
