/**
 * Custom CSS for NeuroDiscuss Theme
 *
 * @package NeuroDiscuss
 */

/* Additional custom styles can be added here */

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-inner {
    text-align: center;
}

.preloader-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    position: relative;
}

.preloader-icon span {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #0F2A44 0%, #137A7F 100%);
    opacity: 0.6;
    animation: preloader-bounce 2s infinite ease-in-out;
}

.preloader-icon span:last-child {
    animation-delay: -1s;
}

@keyframes preloader-bounce {
    0%, 100% {
        transform: scale(0);
    }
    50% {
        transform: scale(1);
    }
}

/* Screen Reader Text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #06b6d4;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 9998;
}

.cookie-notice.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cookie-policy {
    color: #06b6d4;
    text-decoration: none;
}

.cookie-policy:hover {
    text-decoration: underline;
}

/* Age Verification */
.age-verification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.age-verification.show {
    opacity: 1;
    visibility: visible;
}

.age-content {
    background: #1e293b;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    margin: 20px;
}

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

/* Newsletter Popup */
.newsletter-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.newsletter-popup.show {
    opacity: 1;
    visibility: visible;
}

.newsletter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.newsletter-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    margin: 20px;
    position: relative;
    text-align: center;
}

.newsletter-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.newsletter-form-popup {
    margin: 20px 0;
}

.newsletter-form-popup input[type="email"] {
    width: 70%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
}

.newsletter-form-popup button {
    width: 30%;
    padding: 12px;
    border: none;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(135deg, #0F2A44 0%, #137A7F 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form-popup button:hover {
    transform: translateY(-2px);
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    z-index: 9997;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.install-prompt.show {
    transform: translateY(0);
    opacity: 1;
}

.install-content h4 {
    margin: 0 0 10px 0;
    color: #1e293b;
}

.install-content p {
    margin: 0 0 15px 0;
    color: #64748b;
    font-size: 14px;
}

.install-content .button {
    margin-right: 10px;
}

/* Floating Action Button */
.fab-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0F2A44 0%, #137A7F 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(6, 182, 212, 0.4);
}

.fab-items {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-menu.active .fab-items {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1e293b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.fab-item:hover {
    background: #06b6d4;
    transform: scale(1.1);
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(135deg, #0F2A44 0%, #137A7F 100%);
    z-index: 9999;
    width: 0%;
    transition: width 0.3s ease;
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(135deg, #0F2A44 0%, #137A7F 100%);
    z-index: 9998;
    width: 0%;
    transition: width 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #f8fafc;
}

body.dark-mode p,
body.dark-mode li {
    color: #cbd5e1;
}

body.dark-mode .site-header {
    background: #0f172a;
}

body.dark-mode .main-content,
body.dark-mode .sidebar {
    background: #1e293b;
}

body.dark-mode .post-card,
body.dark-mode .doctor-card,
body.dark-mode .speciality-card {
    background: #1e293b;
    border-color: #334155;
}

/* High Contrast Mode */
body.high-contrast {
    background: white;
    color: black;
}

body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6 {
    color: black;
}

body.high-contrast a {
    color: #0066cc;
}

body.high-contrast .btn-primary,
body.high-contrast .hero-button,
body.high-contrast .form-submit {
    background: #0066cc;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .age-actions {
        flex-direction: column;
    }
    
    .newsletter-form-popup input[type="email"],
    .newsletter-form-popup button {
        width: 100%;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .fab-menu {
        bottom: 10px;
        right: 10px;
    }
    
    .fab-main {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .fab-item {
        width: 40px;
        height: 40px;
    }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Utility Classes */
.sr-only {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden;
}

/* Form Messages */
.form-message .alert {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.form-message .alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message .alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Accessibility */
:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

/* Doctor Header Link */
.doctor-header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    background: linear-gradient(135deg, #0F2A44 0%, #137A7F 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.doctor-header-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(6, 182, 212, 0.4);
    color: white;
}

@media (max-width: 768px) {
    .doctor-header-link span {
        display: none;
    }
    .doctor-header-link {
        padding: 0.6rem;
    }
}

/* Print Styles */
@media print {
    .preloader,
    .cookie-notice,
    .age-verification,
    .newsletter-popup,
    .install-prompt,
    .fab-menu,
    .progress-bar,
    .reading-progress {
        display: none !important;
    }
}

/* ============================================================
   Article Type — badge + 4px color stripe
   Each article_type term defines its own --nd-type-color via
   inline style on the element; these rules reference the
   variable so colors come from the taxonomy, not the stylesheet.
   ============================================================ */

.nd-type-badge {
    --nd-type-color: #137A7F;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--nd-type-color);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-transform: uppercase;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.nd-type-badge:hover,
.nd-type-badge:focus-visible {
    color: #fff;
    filter: brightness(1.1);
    transform: translateY(-1px);
    text-decoration: none;
}

.nd-type-badge:focus-visible {
    outline: 2px solid var(--nd-type-color);
    outline-offset: 2px;
}

.nd-type-badge i {
    font-size: 11px;
    line-height: 1;
}

.nd-type-badge-label {
    white-space: nowrap;
}

/* 4px color stripe at the top of a card or article header.
   Apply this class to the wrapper alongside an inline
   style="--nd-type-color: <hex>" set by the host template. */
.nd-type-stripe {
    --nd-type-color: #137A7F;
    position: relative;
    overflow: hidden;
}

.nd-type-stripe::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--nd-type-color);
    z-index: 1;
    pointer-events: none;
}

/* Single-post header variant: thicker stripe and roomier spacing. */
.nd-single-stripe {
    border-top: 6px solid var(--nd-type-color, #137A7F);
    padding-top: 16px;
    margin-top: 16px;
}

/* Card meta row: keep the badge and other meta aligned. */
.entry-meta .nd-type-badge,
.post-meta .nd-type-badge,
.nd-card-meta .nd-type-badge {
    margin-right: 8px;
    vertical-align: middle;
}

/* ============================================================
   Blog filter chips — article_type + subspecialty axes
   ============================================================ */

.nd-blog-filters {
    background: #FAF8F3;
    border: 1px solid #E5E1D8;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 24px;
}

.nd-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.nd-filter-row:last-of-type {
    margin-bottom: 0;
}

.nd-filter-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6B7280;
    margin-right: 4px;
    flex-shrink: 0;
}

.nd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #D1D5DB;
    color: #1F2937;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nd-chip:hover,
.nd-chip:focus-visible {
    background: #F3F4F6;
    border-color: #9CA3AF;
    color: #0F2A44;
    text-decoration: none;
    transform: translateY(-1px);
}

.nd-chip.is-active {
    background: #0F2A44;
    border-color: #0F2A44;
    color: #fff;
}

.nd-chip-type.is-active {
    background: var(--nd-type-color, #137A7F);
    border-color: var(--nd-type-color, #137A7F);
    color: #fff;
}

.nd-chip i {
    font-size: 11px;
}

.nd-filter-clear {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #E5E1D8;
}

.nd-clear-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6B7280;
    text-decoration: none;
}

.nd-clear-link:hover,
.nd-clear-link:focus-visible {
    color: #0F2A44;
    text-decoration: underline;
}

@media (max-width: 640px) {
    .nd-blog-filters {
        padding: 12px;
    }
    .nd-filter-label {
        width: 100%;
        margin-bottom: 4px;
    }
}

/* ============================================================
   Signup / application form (extends .doctor-login-box styles)
   ============================================================ */

.doctor-signup-box {
    max-width: 640px;
}

.doctor-signup-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    margin-bottom: 12px;
}

.doctor-signup-form .form-group {
    margin: 0;
}

.doctor-signup-form .form-group-full {
    grid-column: 1 / -1;
}

.doctor-signup-form .form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6B7280;
}

.doctor-signup-form .required {
    color: #B91C1C;
}

.doctor-signup-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #1F2937;
}

.doctor-signup-form .checkbox-label input[type="checkbox"] {
    margin-top: 3px;
}

.form-footer-sep {
    color: #9CA3AF;
}

.signup-link {
    font-weight: 600;
}

@media (max-width: 640px) {
    .doctor-signup-form .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Verified-only gated content teaser
   ============================================================ */

.nd-gated-excerpt {
    font-size: 1.05em;
    line-height: 1.65;
    color: #1F2937;
    margin-bottom: 24px;
}

.nd-gated-card {
    background: linear-gradient(180deg, #FAF8F3 0%, #F3EFE5 100%);
    border: 1px solid #E5E1D8;
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    margin: 24px 0;
}

.nd-gated-icon {
    font-size: 32px;
    color: #0F2A44;
    margin: 0 0 8px;
}

.nd-gated-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    color: #0F2A44;
}

.nd-gated-body {
    margin: 0 auto 18px;
    max-width: 480px;
    color: #4B5563;
    line-height: 1.55;
}

.nd-gated-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0;
}

.nd-gated-actions .btn-primary,
.nd-gated-actions .btn-secondary {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.nd-gated-actions .btn-primary {
    background: #0F2A44;
    color: #fff;
}

.nd-gated-actions .btn-secondary {
    background: #fff;
    color: #0F2A44;
    border: 1px solid #0F2A44;
}

.nd-gated-actions .btn-primary:hover,
.nd-gated-actions .btn-secondary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    text-decoration: none;
}
