/* MedInfo Newsletter - Main Stylesheet */

:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --accent: #0891b2;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Nav */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
}

.navbar-brand span {
    font-size: 24px;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 24px 60px;
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f7fa 50%, #f0f9ff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(13,148,136,0.05) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-badge {
    display: inline-block;
    background: rgba(13,148,136,0.1);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(13,148,136,0.2);
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text);
}

.hero h1 .gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 36px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

/* Subscribe Form */
.subscribe-form {
    display: flex;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.subscribe-form input[type="email"],
.subscribe-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
    background: var(--surface);
}

.subscribe-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13,148,136,0.1);
}

.subscribe-form button {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.subscribe-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13,148,136,0.3);
}

.subscribe-form button:active {
    transform: translateY(0);
}

.subscribe-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.form-message {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Features Section */
.section {
    padding: 80px 24px;
}

.section-title {
    text-align: center;
    margin-bottom: 56px;
}

.section-title h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 12px;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    border-color: rgba(13,148,136,0.3);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

.feature-icon.clinical { background: #d1fae5; }
.feature-icon.policy { background: #dbeafe; }
.feature-icon.research { background: #e0e7ff; }
.feature-icon.education { background: #fef3c7; }
.feature-icon.alerts { background: #fee2e2; }
.feature-icon.general { background: #f0fdfa; }

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.6;
}

/* How It Works */
.how-it-works {
    background: linear-gradient(135deg, #f0fdfa 0%, #f0f9ff 100%);
}

.steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.step {
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    position: relative;
}

.step-number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-light);
    font-size: 15px;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 80px 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.cta-section h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-section .subscribe-form input {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: white;
}

.cta-section .subscribe-form input::placeholder {
    color: rgba(255,255,255,0.7);
}

.cta-section .subscribe-form input:focus {
    border-color: white;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.15);
}

.cta-section .subscribe-form button {
    background: white;
    color: var(--primary);
}

.cta-section .subscribe-form button:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Footer */
.footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding: 40px 24px;
    text-align: center;
    font-size: 14px;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Verification page */
.verify-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.verify-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 48px;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.verify-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.verify-card h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.verify-card p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 80px 16px 40px;
    }
    
    .subscribe-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .subscribe-form input,
    .subscribe-form button {
        min-width: auto;
    }
    
    .stats {
        gap: 24px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
    }
}

/* Admin styles */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--text);
    color: white;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar .logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.admin-sidebar .logo h2 {
    font-size: 20px;
    font-weight: 700;
}

.admin-sidebar .logo small {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 15px;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-nav a.active {
    border-left: 3px solid var(--primary-light);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background: var(--bg);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Stat Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .sub {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
}

table.admin-table th,
table.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table.admin-table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

table.admin-table tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.badge.active { background: #d1fae5; color: #065f46; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.unsubscribed { background: #fee2e2; color: #991b1b; }
.badge.draft { background: #e2e8f0; color: #475569; }
.badge.sent { background: #d1fae5; color: #065f46; }
.badge.approved { background: #dbeafe; color: #1e40af; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f7fa 50%, #f0f9ff 100%);
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.8rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Article cards in admin */
.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.article-card .article-info {
    flex: 1;
}

.article-card .article-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.article-card .article-info p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

.article-card .article-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}

.article-card .article-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
