/**
 * CannaViva Frontend Styles
 * This file contains all the frontend styling for medical landing pages
 */

/* CSS Variables for Brand Colors */
:root {
    --cv-primary: #006036;
    --cv-secondary: #70c896;
    --cv-accent: #f2b279;
    --cv-text: #333;
    --cv-text-light: #666;
    --cv-light: #f8f9fa;
    --cv-white: #ffffff;
    --cv-border: #ddd;
    --cv-shadow: rgba(0, 0, 0, 0.1);
}

/* Video Block Styles */
.cv-video-block {
    text-align: center;
    padding: 2rem;
    background: var(--cv-light);
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid #e9ecef;
}

.cv-video-icon {
    margin-bottom: 1rem;
    display: inline-block;
}

.cv-video-icon svg {
    transition: transform 0.3s ease;
}

.cv-video-block:hover .cv-video-icon svg {
    transform: scale(1.1);
}

.cv-video-title {
    font-size: 1.5rem;
    color: var(--cv-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.cv-video-description {
    color: var(--cv-text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 16px;
}

.cv-video-button {
    display: inline-block;
    background: var(--cv-primary);
    color: var(--cv-white);
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.cv-video-button:hover {
    background: var(--cv-secondary);
    color: var(--cv-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 96, 54, 0.3);
}

/* Medical Disclaimer Styles */
.cv-medical-disclaimer {
    background: #FEFCE8;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #FACC15;
    padding: 1.5rem;
    margin: 2rem 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
}

.cv-medical-disclaimer strong {
    color: #856404;
}

/* Tip/Info Block Styles */
.cv-tip-block {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--cv-primary);
    position: relative;
    box-shadow: 0 2px 4px var(--cv-shadow);
}

.cv-tip-tip {
    background: #e8f5e8;
    border-left-color: var(--cv-secondary);
}

.cv-tip-info {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.cv-tip-note {
    background: var(--cv-light);
    border-left-color: var(--cv-text-light);
}

/* Warning Block Styles */
.cv-warning-block {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-left: 4px solid #f44336;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 2rem 0;
    color: #c62828;
    font-size: 15px;
    line-height: 1.6;
}

.cv-warning-block strong {
    color: #b71c1c;
}

/* FAQ Section Styles */
.cv-faqs-section {
    margin: 2rem 0;
}

.cv-faqs-section h3 {
    color: var(--cv-primary);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.3;
}

.cv-faq-item {
    border-bottom: 1px solid var(--cv-border);
    margin-bottom: 1rem;
}

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

.cv-faq-question {
    background: var(--cv-light);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--cv-primary);
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 16px;
    line-height: 1.4;
}

.cv-faq-question {
    border-bottom: none !important;
}
.cv-faq-answer {
    border-top: none !important;
}
.cv-faq-item.active .cv-faq-question {
    border-bottom: none !important;
}


.cv-faq-answer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--cv-text);
    display: none;
    line-height: 1.6;
    font-size: 15px;
}

.cv-faq-answer p {
    margin-bottom: 1rem;
}

.cv-faq-answer p:last-child {
    margin-bottom: 0;
}

.cv-faq-item.active .cv-faq-answer {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Profile Section Styles */
.cv-profile-section {
    background: var(--cv-light);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid #e9ecef;
}

.cv-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 3px solid var(--cv-white);
    box-shadow: 0 2px 8px var(--cv-shadow);
}

.cv-profile-name {
    color: var(--cv-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 18px;
}

.cv-profile-credentials {
    color: var(--cv-secondary);
    font-size: 14px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.cv-profile-bio {
    color: var(--cv-text);
    line-height: 1.6;
    font-size: 15px;
}

/* Table of Contents Styles */
.cv-toc {
    background: var(--cv-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid #e9ecef;
}

.cv-toc h3 {
    color: var(--cv-primary);
    margin-bottom: 1rem;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid var(--cv-primary);
    padding-bottom: 0.5rem;
}

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

.cv-toc li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--cv-border);
    transition: padding 0.2s ease;
}

.cv-toc li:last-child {
    border-bottom: none;
}

.cv-toc li:hover {
    padding-left: 0.5rem;
}

.cv-toc a {
    color: var(--cv-text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: block;
}

.cv-toc a:hover {
    color: var(--cv-primary);
}

.cv-toc-sub {
    padding-left: 1rem;
}

.cv-toc-sub a {
    font-size: 13px;
    color: var(--cv-text-light);
}

/* Related Articles Styles */
.cv-related-articles {
    margin: 2rem 0;
}

.cv-related-articles h3 {
    color: var(--cv-primary);
    margin-bottom: 2rem;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 3px solid var(--cv-primary);
    padding-bottom: 0.5rem;
}

.cv-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.cv-related-item {
    background: var(--cv-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--cv-shadow);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.cv-related-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 96, 54, 0.15);
}

.cv-related-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cv-related-item:hover img {
    transform: scale(1.05);
}

.cv-related-item h4 {
    padding: 1rem 1rem 0.5rem;
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

.cv-related-item h4 a {
    color: var(--cv-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.cv-related-item h4 a:hover {
    color: var(--cv-secondary);
}

.cv-related-item p {
    padding: 0 1rem 1rem;
    color: var(--cv-text-light);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Reading Progress Bar */
.cv-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.single-cv_medical_page .cv-reading-progress {
    opacity: 1;
}

.cv-reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cv-primary), var(--cv-secondary));
    width: 0%;
    transition: width 0.2s ease;
}

/* Tooltip Styles */
.cv-tooltip {
    background: var(--cv-text);
    color: var(--cv-white);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease-out forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Copyable Headings */
.cv-copyable-heading {
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.cv-copyable-heading:hover {
    color: var(--cv-primary);
}

.cv-copyable-heading:hover::after {
    content: '🔗';
    position: absolute;
    right: -25px;
    opacity: 0.6;
    font-size: 0.8em;
}

/* Print Styles */
@media print {
    .cv-references-list {
        display: block !important;
    }
    
    .cv-faq-answer {
        display: block !important;
    }
    
    .cv-reading-progress,
    .cv-video-block,
    .cv-tooltip {
        display: none !important;
    }
    
    .cv-faq-question::after {
        display: none;
    }
    
    .cv-related-item {
        break-inside: avoid;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .cv-video-block {
        padding: 1.5rem 1rem;
        margin: 1.5rem 0;
    }
    
    .cv-video-title {
        font-size: 1.25rem;
    }
    
    .cv-video-description {
        font-size: 14px;
    }
    
    .cv-toc,
    .cv-medical-disclaimer,
    .cv-tip-block,
    .cv-warning-block,
    .cv-references-section,
    .cv-profile-section {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .cv-faq-question {
        font-size: 15px;
        padding: 0.75rem 1rem;
        padding-right: 2.5rem;
    }
    
    .cv-faq-question::after {
        right: 1rem;
    }
    
    .cv-faq-answer {
        padding: 0 1rem 1rem 1rem;
        font-size: 14px;
    }
    
    .cv-related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cv-related-item img {
        height: 150px;
    }
    
    .cv-toc a,
    .cv-reference-item {
        font-size: 13px;
    }
    
    .cv-profile-avatar {
        width: 60px;
        height: 60px;
    }
    
    .cv-profile-name {
        font-size: 16px;
    }
    
    .cv-profile-credentials {
        font-size: 13px;
    }
    
    .cv-profile-bio {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cv-video-block {
        padding: 1rem;
    }
    
    .cv-video-title {
        font-size: 1.1rem;
    }
    
    .cv-video-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .cv-faq-question {
        font-size: 14px;
    }
    
    .cv-related-item h4 {
        font-size: 15px;
        padding: 0.75rem 0.75rem 0.5rem;
    }
    
    .cv-related-item p {
        padding: 0 0.75rem 0.75rem;
        font-size: 13px;
    }
}

/* High DPI / Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .cv-video-icon svg,
    .cv-profile-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .cv-light {
        background: #2d3748;
    }
    
    .cv-text {
        color: #e2e8f0;
    }
    
    .cv-text-light {
        color: #a0aec0;
    }
    
    .cv-border {
        color: #4a5568;
    }
}

/* Focus States for Accessibility */
.cv-faq-question:focus,
.cv-references-title:focus,
.cv-toc a:focus,
.cv-video-button:focus {
    outline: 2px solid var(--cv-primary);
    outline-offset: 2px;
}

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

/* Add these styles to the END of your frontend.css file */

/* Reviewer Badge Widget (Sidebar) */
.cv-reviewer-badge {
    background: #e8f5e8;
    border: 1px solid #70c896;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 14px;
}

.cv-reviewer-badge h4 {
    color: #333;
    margin: 0 0 0.25rem 0;
    font-size: 14px;
    font-weight: 600;
}

.cv-reviewer-badge p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

/* Enhanced Reference Links */
.cv-reference-link {
    color: #006036;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.cv-reference-link:hover {
    color: #70c896;
    text-decoration: underline;
}

/* Reference anchors in content */
.cv-ref-anchor {
    color: #006036;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    vertical-align: super;
    padding: 0 2px;
}

.cv-ref-anchor:hover {
    color: #70c896;
    text-decoration: underline;
}

/* Admin FAQ expandable styling */
.cv-faq-row {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 10px;
}

#cv-add-faq {
    background: #006036;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

#cv-add-faq:hover {
    background: #70c896;
}

/* Block visibility fixes */
.cv-safety-tip,
.cv-info-box,
.cv-warning-box {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .cv-reviewer-badge {
        padding: 0.75rem;
        font-size: 13px;
    }
    
    .cv-icon-list {
        justify-content: center;
        gap: 0.25rem;
    }
    
    .cv-icon-list a,
    .cv-icon-list span {
        font-size: 11px;
        padding: 0.4rem 0.8rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cv-reviewer-badge,
    .cv-safety-tip,
    .cv-info-box,
    .cv-warning-box {
        border-width: 2px;
    }
    
    .cv-reference-link,
    .cv-ref-anchor {
        text-decoration: underline;
        font-weight: bold;
    }
}

/* Shortcode Styling */
.cv-safety-shortcode { background: #e3f2fd !important; border-left: 4px solid #2196f3 !important; }
.cv-process-shortcode { background: #e8f5e8 !important; border-left: 4px solid #70c896 !important; }
.cv-alert-shortcode { background: #ffebee !important; border-left: 4px solid #f44336 !important; }


.cv-faq-arrow {
    transition: transform 0.3s ease !important;
    transform-origin: center !important;
    display: inline-block !important;
}

/* Only rotate when FAQ is active/expanded */
.cv-faq-item.active .cv-faq-arrow {
    transform: rotate(180deg) !important;
}


/* Mobile responsive fix for dates widget */
@media (max-width: 768px) {
    .cv-dates {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
        font-size: 12px !important;
    }
    
    .cv-dates span {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    /* Hide the separator pipes on mobile */
    .cv-dates span:nth-child(2),
    .cv-dates span:nth-child(4) {
        display: none !important;
    }
}