/* ==========================================================================
   AI Dose Med - Academic Journal Theme
   Vanilla CSS (converted from Tailwind)
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors - Academic Navy */
    --primary: #2b3d4f;
    --primary-light: #3d5a73;
    --primary-dark: #1a2836;
    
    /* Background Colors */
    --bg-light: #f5f5f5;
    --bg-dark: #212a36;
    --bg-card: #ffffff;
    --bg-card-dark: #2a3441;
    
    /* Text Colors */
    --text-primary: #2b3d4f;
    --text-secondary: rgba(43, 61, 79, 0.7);
    --text-muted: rgba(43, 61, 79, 0.5);
    --text-light: #ffffff;
    
    /* Accent Colors */
    --accent-teal: #14b8a6;
    --accent-red: #dc2626;
    
    /* Border & Divider */
    --border-light: rgba(43, 61, 79, 0.1);
    --border-medium: rgba(43, 61, 79, 0.2);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    
    /* Typography */
    --font-display: 'Newsreader', Georgia, serif;
    --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --container-max: 1200px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.125rem;
    --radius-md: 0.25rem;
    --radius-lg: 0.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark Mode */
.dark {
    --bg-light: #212a36;
    --bg-card: #2a3441;
    --text-primary: #e5e7eb;
    --text-secondary: rgba(229, 231, 235, 0.7);
    --text-muted: rgba(229, 231, 235, 0.5);
    --border-light: rgba(229, 231, 235, 0.1);
    --border-medium: rgba(229, 231, 235, 0.2);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.flex-grow {
    flex-grow: 1;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
    width: 100%;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-brand .icon {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.header-login {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-base);
}

.header-login:hover {
    color: var(--primary-light);
}

/* --------------------------------------------------------------------------
   Main Layout - Editorial Grid
   -------------------------------------------------------------------------- */
.main-content {
    flex-grow: 1;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.editorial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
    position: relative;
}

@media (min-width: 1024px) {
    .editorial-grid {
        grid-template-columns: 7fr 5fr;
    }
}

/* --------------------------------------------------------------------------
   Article Column (Left)
   -------------------------------------------------------------------------- */
.article-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    position: relative;
    padding-right: 0;
}

@media (min-width: 1024px) {
    .article-column {
        padding-right: var(--spacing-2xl);
    }
    
    .article-column::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 1px;
        background-color: var(--border-light);
    }
}

/* Meta Info */
.meta-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Headline */
.headline {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 500;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* Byline */
.byline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.byline-author {
    font-weight: 700;
    font-style: italic;
    color: var(--text-primary);
}

.byline-curated {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: var(--font-body);
}

/* Abstract/Body */
.abstract {
    font-family: var(--font-body);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: none;
}

.abstract-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-style: italic;
}

.abstract p {
    margin-bottom: var(--spacing-lg);
}

.abstract p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Registration Card (Right Sidebar)
   -------------------------------------------------------------------------- */
.sidebar-column {
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

@media (min-width: 1024px) {
    .sidebar-column {
        padding-top: 0;
    }
}

.sidebar-sticky {
    position: sticky;
    top: 6rem;
}

.registration-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.dark .registration-card {
    background-color: var(--bg-card-dark);
}

/* Decorative Corner */
.registration-card::before {
    content: '';
    position: absolute;
    top: -2rem;
    right: -2rem;
    width: 4rem;
    height: 4rem;
    background-color: rgba(43, 61, 79, 0.05);
    border-radius: 0 0 0 100%;
}

.card-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Form Styles
   -------------------------------------------------------------------------- */
.signup-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.form-input {
    width: 100%;
    height: 3rem;
    padding: 0 var(--spacing-md);
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-light);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-base);
}

.dark .form-input {
    background-color: var(--bg-dark);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--text-primary);
}

/* Form Grid for profile fields */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

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

/* Submit Button */
.submit-btn {
    width: 100%;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.submit-btn:hover:not(:disabled) {
    background-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn .icon {
    font-size: 0.875rem;
}

/* Secondary Button */
.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-light);
    color: var(--text-primary);
    box-shadow: none;
}

/* Turnstile Container */
.turnstile-container {
    display: flex;
    justify-content: center;
    margin: var(--spacing-sm) 0;
}

/* Form Message */
.form-message {
    padding: 0.75rem var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-body);
    text-align: center;
    display: none;
}

.form-message.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.form-message.success {
    background-color: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #0d9488;
}

.form-message.error {
    background-color: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #dc2626;
}

/* Step 2 Profile Fields */
.step-2-fields {
    display: none;
    flex-direction: column;
    gap: var(--spacing-md);
    animation: slideUpFadeIn 0.3s ease-out;
}

.step-2-fields.show {
    display: flex;
}

.success-banner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.05));
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: var(--radius-md);
    color: #0d9488;
    font-weight: 600;
    animation: fadeInScale 0.3s ease-out;
}

.success-banner.show {
    display: flex;
}

/* --------------------------------------------------------------------------
   Trust Indicators
   -------------------------------------------------------------------------- */
.trust-section {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(43, 61, 79, 0.05);
}

.trust-section .icon {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-top: 0.125rem;
}

.trust-section p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    line-height: 1.5;
}

.trust-section .highlight {
    font-weight: 600;
    color: var(--text-primary);
}

/* Testimonial Quote */
.testimonial {
    margin-top: var(--spacing-xl);
    padding-left: var(--spacing-md);
    border-left: 2px solid var(--border-medium);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.testimonial-author {
    display: block;
    font-style: normal;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--font-body);
    margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Archive Ribbon
   -------------------------------------------------------------------------- */
.archive-ribbon {
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-card);
    padding: var(--spacing-md) 0;
    width: 100%;
}

.dark .archive-ribbon {
    background-color: var(--bg-card-dark);
}

.archive-ribbon-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.archive-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    flex-shrink: 0;
    font-family: var(--font-body);
}

.archive-scroll {
    flex-grow: 1;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.archive-scroll::-webkit-scrollbar {
    height: 4px;
}

.archive-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.archive-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

.archive-list {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

.archive-item:hover {
    color: var(--text-primary);
}

.archive-item:hover .archive-item-title {
    border-bottom-color: var(--text-primary);
}

.archive-item-date {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.archive-item-title {
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-base);
}

.archive-divider {
    color: var(--border-medium);
    font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-2xl) 0;
    text-align: center;
}

.dark .footer {
    background-color: var(--bg-dark);
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.footer-icon {
    width: 2rem;
    height: 2rem;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
    font-size: 0.875rem;
    font-family: var(--font-body);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Thank You Page Specific
   -------------------------------------------------------------------------- */
.thank-you-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.thank-you-card {
    max-width: 500px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease-out;
}

.thank-you-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.thank-you-card h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.thank-you-card p {
    color: var(--text-secondary);
    font-family: var(--font-body);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
}

.thank-you-card .next-steps {
    text-align: left;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
}

.thank-you-card .next-steps h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-body);
}

.thank-you-card .next-steps ul {
    list-style: none;
    padding: 0;
}

.thank-you-card .next-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
    margin-bottom: 0.5rem;
}

.thank-you-card .next-steps li::before {
    content: '✓';
    color: var(--accent-teal);
    font-weight: 700;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.btn-back:hover {
    background-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Archive Page Specific
   -------------------------------------------------------------------------- */
.archive-page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: var(--spacing-2xl);
    text-align: center;
}

.archive-page-header h1 {
    color: var(--text-light);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.archive-page-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.archive-page-header a {
    color: var(--accent-teal);
    text-decoration: none;
}

.archive-page-header a:hover {
    text-decoration: underline;
}

.archive-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: var(--spacing-lg);
    transition: opacity var(--transition-base);
}

.back-link:hover {
    opacity: 0.8;
}

.month-section {
    margin-bottom: var(--spacing-xl);
}

.month-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-teal);
    margin-bottom: var(--spacing-md);
}

.campaign-card {
    display: block;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
}

.campaign-card:hover {
    border-color: var(--accent-teal);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.campaign-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.campaign-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-body);
}

/* Email content display */
.email-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-md);
}

.email-meta {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.email-subject {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.email-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-body);
}

.email-body {
    line-height: 1.7;
    font-family: var(--font-body);
}

.email-body img {
    max-width: 100%;
    height: auto;
}

/* Empty/Error States */
.empty-state,
.error-state {
    text-align: center;
    padding: var(--spacing-2xl);
}

.empty-state h2,
.error-state h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.error-state {
    color: var(--accent-red);
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .archive-page-header h1 {
        font-size: 1.5rem;
    }
    
    .archive-container {
        padding: var(--spacing-md);
    }
    
    .email-content {
        padding: var(--spacing-md);
    }
}
