/* ==========================================================================
   CollegeVaani SEO Enhancement Styles
   Version: 1.0
   Purpose: Improve UX signals, accessibility, and Core Web Vitals
   ========================================================================== */

/* ==========================================================================
   1. ACCESSIBILITY & SCREEN READER SUPPORT
   ========================================================================== */

/* Skip to main content link for accessibility */
.skip-to-main {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #667eea;
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s ease;
}

.skip-to-main:focus {
    top: 0;
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==========================================================================
   2. BREADCRUMB STYLES (SEO Critical)
   ========================================================================== */

.cv-breadcrumb-nav {
    padding: 12px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.cv-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 14px;
}

.cv-breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.cv-breadcrumb-item a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cv-breadcrumb-item a:hover {
    color: #667eea;
    text-decoration: underline;
}

.cv-breadcrumb-item.active {
    color: #1e293b;
    font-weight: 500;
}

.cv-breadcrumb-separator {
    color: #94a3b8;
    margin: 0 4px;
}

.cv-breadcrumb-separator::before {
    content: "›";
    font-size: 16px;
}

/* ==========================================================================
   3. HEADING HIERARCHY STYLES
   ========================================================================== */

h1, .h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1e293b;
}

h2, .h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.875rem;
    color: #1e293b;
}

h3, .h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #334155;
}

h4, .h4 {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.625rem;
    color: #334155;
}

h5, .h5 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    color: #475569;
}

h6, .h6 {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    color: #475569;
}

/* ==========================================================================
   4. INTERNAL LINKING STYLES
   ========================================================================== */

/* Related content sections */
.cv-related-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    border: 1px solid #e2e8f0;
}

.cv-related-section h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cv-related-section h3 i {
    color: #667eea;
}

.cv-related-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.cv-related-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cv-related-link:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cv-related-link i {
    font-size: 12px;
    opacity: 0.7;
}

/* Quick links widget */
.cv-quick-links {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
}

.cv-quick-links h4 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 1rem;
}

.cv-quick-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cv-quick-links li {
    margin-bottom: 8px;
}

.cv-quick-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    transition: all 0.2s ease;
}

.cv-quick-links a:hover {
    color: #fff;
    padding-left: 8px;
}

.cv-quick-links a::before {
    content: "→";
    font-size: 12px;
    opacity: 0.7;
}

/* ==========================================================================
   5. TABLE OF CONTENTS (For Long Content)
   ========================================================================== */

.cv-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    position: sticky;
    top: 80px;
}

.cv-toc-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cv-toc-title i {
    color: #667eea;
}

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

.cv-toc-list li {
    margin-bottom: 8px;
}

.cv-toc-list a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 6px 12px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.cv-toc-list a:hover,
.cv-toc-list a.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
}

.cv-toc-list .cv-toc-h3 {
    padding-left: 24px;
    font-size: 13px;
}

/* ==========================================================================
   6. E-E-A-T SIGNALS (Trust & Authority)
   ========================================================================== */

/* Author box for articles */
.cv-author-box {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 24px 0;
}

.cv-author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.cv-author-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #1e293b;
}

.cv-author-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.cv-author-bio {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

/* Trust badges */
.cv-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

.cv-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    font-size: 13px;
    color: #047857;
    font-weight: 500;
}

.cv-trust-badge i {
    color: #10b981;
}

.cv-trust-badge--verified {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.cv-trust-badge--verified i {
    color: #3b82f6;
}

/* Last updated indicator */
.cv-last-updated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.cv-last-updated i {
    color: #10b981;
}

/* Expert reviewed badge */
.cv-expert-reviewed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    font-weight: 500;
}

.cv-expert-reviewed i {
    color: #f59e0b;
}

/* ==========================================================================
   7. FAQ SCHEMA-READY STYLES
   ========================================================================== */

.cv-faq-section {
    margin: 32px 0;
}

.cv-faq-section h2 {
    margin-bottom: 24px;
}

.cv-faq-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.cv-faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cv-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 600;
    color: #1e293b;
    transition: background 0.2s ease;
}

.cv-faq-question:hover {
    background: #f1f5f9;
}

.cv-faq-question i {
    color: #667eea;
    transition: transform 0.3s ease;
}

.cv-faq-item.active .cv-faq-question i {
    transform: rotate(180deg);
}

.cv-faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cv-faq-item.active .cv-faq-answer {
    padding: 16px 20px;
    max-height: 500px;
}

.cv-faq-answer p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

/* ==========================================================================
   8. CTA OPTIMIZATION (Conversion Signals)
   ========================================================================== */

.cv-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.cv-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: #fff;
}

.cv-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cv-cta-secondary:hover {
    background: #667eea;
    color: #fff;
}

.cv-cta-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #25d366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cv-cta-whatsapp:hover {
    background: #128c7e;
    color: #fff;
    transform: translateY(-2px);
}

/* Sticky CTA bar */
.cv-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cv-sticky-cta.visible {
    display: block;
    transform: translateY(0);
}

.cv-sticky-cta-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 16px;
}

.cv-sticky-cta-info {
    flex: 1;
}

.cv-sticky-cta-info h4 {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.cv-sticky-cta-info p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

/* ==========================================================================
   9. IMAGE SEO OPTIMIZATION
   ========================================================================== */

/* Lazy loading placeholder */
.cv-img-placeholder {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Image with caption */
.cv-figure {
    margin: 24px 0;
}

.cv-figure img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

.cv-figure figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    font-style: italic;
}

/* ==========================================================================
   10. CORE WEB VITALS OPTIMIZATION
   ========================================================================== */

/* Prevent CLS - Reserve space for images */
.cv-img-container {
    position: relative;
    overflow: hidden;
}

.cv-img-container::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.cv-img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-img-container--square::before {
    padding-top: 100%;
}

.cv-img-container--4-3::before {
    padding-top: 75%;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   11. SEMANTIC CONTENT SECTIONS
   ========================================================================== */

/* Article structure */
.cv-article {
    max-width: 800px;
    margin: 0 auto;
}

.cv-article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.cv-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #64748b;
}

.cv-article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cv-article-content {
    font-size: 17px;
    line-height: 1.8;
    color: #334155;
}

.cv-article-content p {
    margin-bottom: 1.5em;
}

.cv-article-content h2 {
    margin-top: 2em;
    margin-bottom: 1em;
    padding-top: 1em;
    border-top: 1px solid #e2e8f0;
}

.cv-article-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.cv-article-content ul,
.cv-article-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.cv-article-content li {
    margin-bottom: 0.5em;
}

/* ==========================================================================
   12. MOBILE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
    .cv-breadcrumb {
        font-size: 12px;
    }
    
    .cv-related-links {
        grid-template-columns: 1fr;
    }
    
    .cv-author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .cv-trust-badges {
        justify-content: center;
    }
    
    .cv-sticky-cta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cv-sticky-cta-info {
        margin-bottom: 8px;
    }
    
    .cv-toc {
        position: relative;
        top: 0;
    }
}

/* ==========================================================================
   13. PRINT STYLES
   ========================================================================== */

@media print {
    .cv-sticky-cta,
    .cv-quick-links,
    .skip-to-main,
    nav,
    footer,
    .cv-cta-primary,
    .cv-cta-secondary {
        display: none !important;
    }
    
    .cv-article-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}
