/* ========== ROOT VARIABLES ========== */
:root {
    --primary-color: #0369a1;
    --primary-dark: #075985;
    --primary-light: #0ea5e9;
    --secondary-color: #0891b2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition-speed: 0.3s;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* ========== RESET & BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, #e0f2fe 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== HEADER ========== */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 60px 60px;
    opacity: 0.3;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.125rem;
    opacity: 0.95;
    font-weight: 400;
}

/* ========== NAVIGATION ========== */
nav {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    border-bottom: 2px solid var(--gray-100);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

nav li {
    flex: 1;
    min-width: 160px;
}

nav .nav-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

nav .nav-btn:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    border-bottom-color: var(--primary-light);
}

nav .nav-btn.active {
    background: linear-gradient(to bottom, var(--gray-50), white);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ========== MAIN CONTENT ========== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
}

.section {
    display: none;
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s ease;
}

.section.active {
    display: block;
}

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

/* ========== SECTION HEADER ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
}

/* ========== PIRADS CONTAINER ========== */
.pirads-container {
    margin-bottom: 0.75rem;
}

.pirads-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.pirads-title {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pirads-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* ========== WELCOME CONTENT ========== */
.welcome-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.info-card h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.info-card p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.0625rem;
}

/* ========== QUICK START GRID ========== */
.quick-start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.zone-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 2px solid var(--gray-300);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.zone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform var(--transition-speed) ease;
}

.zone-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.zone-card:hover::before {
    transform: scaleX(1);
}

.zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform var(--transition-speed) ease;
}

.zone-card:hover .zone-icon {
    transform: scale(1.1);
}

.zone-card h3 {
    color: var(--primary-color);
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.zone-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.zone-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.zone-cta {
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--border-radius);
    display: inline-block;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-sm);
}

.zone-card:hover .zone-cta {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ========== FEATURES GRID ========== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-speed) ease;
}

.feature-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-item strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 1.0625rem;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.5;
}

/* ========== PIRADS SECTION ========== */
.pirads-section {
    margin-bottom: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border-left: 4px solid var(--primary-color);
    transition: all var(--transition-speed) ease;
}

.pirads-section:hover {
    background: #f0f9ff;
    border-left-color: var(--secondary-color);
}

.pirads-section-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pirads-badge {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.pirads-section-desc {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-icon {
    cursor: help;
    font-size: 1.125rem;
}

/* ========== PROGRESS INDICATOR ========== */
.progress-indicator {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--primary-dark);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
    border-left: 4px solid var(--primary-color);
    font-size: 0.9375rem;
    box-shadow: var(--shadow-sm);
}

/* ========== RADIO GROUP ========== */
.pirads-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pirads-radio-option {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.pirads-radio-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pirads-radio-option:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
    transform: translateX(2px);
}

.pirads-radio-option:hover::before {
    opacity: 1;
}

.pirads-radio-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #dbeafe, #f0f9ff);
    box-shadow: var(--shadow-md);
}

.pirads-radio-option.selected::before {
    opacity: 1;
}

.pirads-radio-option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.pirads-radio-label {
    flex: 1;
    cursor: pointer;
}

.pirads-radio-label strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.pirads-radio-label span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* ========== INFO BOX ========== */
.pirads-info-box {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.pirads-info-box strong {
    color: #92400e;
    display: inline;
}

/* ========== RESULT BOX ========== */
.pirads-result-box {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

.pirads-result-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-25%, -25%); }
    50% { transform: translate(25%, 25%); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pirads-result-box > * {
    position: relative;
    z-index: 1;
}

.pirads-result-box.score-1 {
    background: linear-gradient(135deg, #10b981, #059669);
}

.pirads-result-box.score-2 {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.pirads-result-box.score-3 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.pirads-result-box.score-4 {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.pirads-result-box.score-5 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.pirads-score-display {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin: 1rem 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    letter-spacing: -2px;
}

.pirads-score-label {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pirads-score-desc {
    font-size: 1.125rem;
    margin: 0.75rem 0;
    opacity: 0.95;
}

.pirads-score-rate {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    display: inline-block;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.pirads-result-box .result-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-print, .btn-save {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-size: 0.9375rem;
}

.btn-print:hover, .btn-save:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ========== BUTTONS ========== */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== SEO CONTENT ========== */
.seo-content {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    margin: 1.25rem 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.seo-content h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.seo-content p {
    margin-bottom: 1rem;
}

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

/* ========== DISCLAIMER ========== */
.pirads-disclaimer {
    font-size: 0.9375rem;
    text-align: center;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    margin-top: 1.5rem;
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    line-height: 1.8;
    border: 2px solid #fecaca;
    box-shadow: var(--shadow-sm);
}

.pirads-disclaimer strong {
    color: #7f1d1d;
    font-weight: 700;
}

/* ========== HISTORY SECTION ========== */
.history-info {
    background: #dbeafe;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    border-left: 4px solid var(--primary-color);
    font-size: 0.9375rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.history-item {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-zone {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.history-timestamp {
    color: var(--text-light);
    font-size: 0.875rem;
    white-space: nowrap;
}

.history-score {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    margin: 0.5rem 0;
}

.history-score.score-1 { background: #10b981; }
.history-score.score-2 { background: #06b6d4; }
.history-score.score-3 { background: #f59e0b; }
.history-score.score-4 { background: #f97316; }
.history-score.score-5 { background: #ef4444; }

.history-details {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.history-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.history-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ========== GUIDE SECTION ========== */
#guide-content {
    line-height: 1.8;
}

#guide-content h2 {
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.875rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
    font-weight: 600;
}

#guide-content h2:first-child {
    margin-top: 0;
}

#guide-content h3 {
    color: var(--primary-dark);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.375rem;
    font-weight: 600;
}

#guide-content p {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
}

#guide-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

#guide-content ul,
#guide-content ol {
    margin-bottom: 1.25rem;
    margin-left: 2rem;
    color: var(--text-primary);
}

#guide-content li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.category-box {
    background: white;
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
}

.category-box:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.category-box.score-1 {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-left-color: #10b981;
}

.category-box.score-2 {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-left-color: #06b6d4;
}

.category-box.score-3 {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left-color: #f59e0b;
}

.category-box.score-4 {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border-left-color: #f97316;
}

.category-box.score-5 {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-left-color: #ef4444;
}

.category-box strong {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 700;
}

.category-box p {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

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

/* ========== AUTHOR BIO ========== */
.author-bio-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.author-photo {
    flex: 0 0 auto;
    min-width: 250px;
}

.author-photo img {
    width: 100%;
    max-width: 300px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 4px solid white;
}

.author-content {
    flex: 1;
    min-width: 300px;
}

.author-content h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.author-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1rem;
}

.author-content a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color var(--transition-speed) ease;
}

.author-content a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ========== FOOTER ========== */
footer {
    background: var(--gray-800);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2.5rem;
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.9375rem;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: underline;
    transition: opacity var(--transition-speed) ease;
}

footer a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* ========== VOLUME & PSA DENSITY CALCULATOR ========== */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.calculator-subsection {
    display: flex;
    flex-direction: column;
}

.measurement-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-field label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed) ease;
}

.input-with-unit:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.input-with-unit input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0;
    color: var(--text-primary);
    font-weight: 500;
}

.input-with-unit input::placeholder {
    color: var(--text-light);
}

.unit-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.input-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: -0.25rem;
}

.formula-reference {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    color: var(--primary-dark);
    border-left: 4px solid var(--primary-color);
}

.formula-reference strong {
    font-weight: 700;
}

.volume-result, .psad-result {
    min-height: 50px;
}

.result-display {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 3px solid;
    animation: slideIn 0.5s ease;
}

.result-display.normal {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.result-display.mild {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.result-display.moderate {
    border-color: #f97316;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
}

.result-display.severe {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.result-display.low-risk {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.result-display.intermediate-risk {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.result-display.elevated-risk {
    border-color: #f97316;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
}

.result-display.high-risk {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.result-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.result-unit {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.result-classification {
    margin: 1rem 0;
}

.classification-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.classification-badge.normal {
    background: linear-gradient(135deg, #10b981, #059669);
}

.classification-badge.mild {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.classification-badge.moderate {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.classification-badge.severe {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.classification-badge.low-risk {
    background: linear-gradient(135deg, #10b981, #059669);
}

.classification-badge.intermediate-risk {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.classification-badge.elevated-risk {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.classification-badge.high-risk {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.result-description {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.result-recommendation {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.info-expandable {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.info-expandable-header {
    background: linear-gradient(135deg, var(--gray-50), white);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
    transition: all var(--transition-speed) ease;
    border-bottom: 2px solid var(--gray-200);
}

.info-expandable-header:hover {
    background: linear-gradient(135deg, #dbeafe, #f0f9ff);
}

.toggle-icon {
    font-size: 1rem;
    transition: transform var(--transition-speed) ease;
}

.info-expandable-content {
    padding: 1.5rem;
    display: none;
    background: var(--gray-50);
}

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

.reference-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.reference-card h4 {
    color: var(--primary-color);
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.reference-card p {
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

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

.reference-card ul {
    margin: 0.75rem 0 0 1.5rem;
    color: var(--text-primary);
}

.reference-card li {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.reference-card a {
    color: var(--primary-color);
    text-decoration: underline;
}

.reference-card a:hover {
    color: var(--primary-dark);
}

.history-volume-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.history-metric {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9375rem;
}

.history-metric strong {
    color: var(--text-primary);
}

.history-metric .classification-badge {
    font-size: 0.8125rem;
    padding: 0.25rem 0.75rem;
}

.history-measurement-detail {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
}

/* ========== PRINT STYLES ========== */
@media print {
    body {
        background: white;
    }

    header, nav, footer, .action-buttons, .btn-secondary {
        display: none !important;
    }

    .section {
        display: block !important;
        box-shadow: none;
        page-break-after: always;
    }

    .pirads-result-box {
        border: 2px solid #333;
        color: #333 !important;
        background: white !important;
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.875rem;
    }

    header p {
        font-size: 1rem;
    }

    nav .nav-btn {
        padding: 0.875rem 0.75rem;
        font-size: 0.875rem;
        min-width: 120px;
    }

    .section {
        padding: 1.5rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .pirads-title {
        font-size: 1.5rem;
    }

    .pirads-score-display {
        font-size: 3rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .author-bio-container {
        flex-direction: column;
    }

    .author-photo {
        min-width: auto;
        width: 100%;
        text-align: center;
    }

    .quick-start-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .history-item-header {
        flex-direction: column;
    }

    .history-timestamp {
        align-self: flex-start;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .reference-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    header {
        padding: 1.5rem 1rem;
    }

    .section {
        padding: 1rem;
    }

    .zone-card {
        padding: 1.5rem;
    }

    .pirads-section {
        padding: 1rem;
    }

    .pirads-radio-option {
        padding: 0.875rem;
    }
}

/* ========== ACCESSIBILITY ========== */
@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;
    }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}
