:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgb(37 99 235 / 25%);
    
    /* Legacy Primary (for backward compatibility) */
    --primary-color: var(--primary);
    --primary-color-light: var(--primary-light);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --accent: #36cfc9;
    
    /* Legacy Semantic (for backward compatibility) */
    --success-color: var(--success);
    --warning-color: var(--warning);
    --danger-color: var(--danger);
    --info-color: var(--info);
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --surface-elevated: #ffffff;
    --background: #f8fafc;
    
    /* Legacy Surface (for backward compatibility) */
    --surface-color: var(--surface);
    --light-bg: var(--background);
    --secondary-bg: #e2e8f0;
    
    /* Border Colors */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Legacy Border (for backward compatibility) */
    --border-color: var(--border);
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Legacy Text (for backward compatibility) */
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --secondary-color: #334155;
    
    /* Shadow System */
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --shadow-xl: 0 20px 25px rgb(15 23 42 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* Legacy Border Radius (for backward compatibility) */
    --border-radius: var(--radius-lg);
    --border-radius-sm: var(--radius-md);
    --border-radius-lg: var(--radius-xl);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Layout */
    --max-width-reading: 720px;
    --max-width-content: 1200px;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.ideal-weight-calculator-page {
    padding: 2rem 0;
}

.iw-intro {
    margin-bottom: 2rem;
    padding: 0;
}

.iw-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.iw-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    max-width: 700px;
    line-height: 1.6;
}

.iw-meta {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--light-bg);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.iw-main {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.iw-card {
    padding: 0rem 2rem;
    height: 100%;
}

.iw-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.angle-support {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

.tooltip {
    position: relative;
    display: inline-flex;
}

.tooltip-trigger {
    border: none;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    border-radius: 999px;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    font-size: 0.8125rem;
    font-weight: 700;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tooltip-trigger:hover {
    background: rgba(37, 99, 235, 0.2);
    transform: scale(1.05);
}

.tooltip-text {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    max-width: 200px;
    white-space: normal;
    text-align: center;
}

.tooltip-trigger:hover + .tooltip-text,
.tooltip-trigger:focus + .tooltip-text {
    opacity: 1;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.select-row {
    margin-bottom: 0.5rem;
}

.unit-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.field-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.height-input-wrapper,
.weight-input-wrapper {
    display: flex;
    gap: 0.75rem;
}

.height-imperial-inputs {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.height-imperial-inputs .field-input {
    flex: 1;
}

.gender-group {
    display: flex;
    gap: 0.75rem;
}

.gender-btn {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gender-btn:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.gender-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: var(--surface-color);
    color: var(--text-main);
    border: 2px solid var(--border-color);
}

.secondary-btn:hover {
    background: var(--background);
    border-color: var(--primary);
    color: var(--primary);
}

.result-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 500px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.result-number {
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    margin: 2rem 0;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.result-equation {
    text-align: center;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.conversion-formula {
    background: var(--iw-background);
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.formula-text {
    text-align: center;
    color: var(--iw-text);
    font-weight: 600;
    margin: 0;
}

.iw-detailed-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
}

.iw-formula-result {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.iw-formula-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.iw-formula-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.result-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--iw-border);
}

.copy-buttons-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    font-size: 1rem;
    flex: 1 1 auto;
    min-width: 140px;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.share-container {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 1rem;
}

.share-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
}

.share-x {
    background: #000000;
    color: white;
}

.share-x:hover {
    background: #333333;
}

.share-facebook {
    background: #1877f2;
    color: white;
}

.share-facebook:hover {
    background: #166fe5;
}

.share-linkedin {
    background: #0a66c2;
    color: white;
}

.share-linkedin:hover {
    background: #095d9e;
}

.share-reddit {
    background: #ff4500;
    color: white;
}

.share-reddit:hover {
    background: #e63e00;
}

.share-telegram {
    background: #0088cc;
    color: white;
}

.share-telegram:hover {
    background: #0077b5;
}

.share-whatsapp {
    background: #25d366;
    color: white;
}

.share-whatsapp:hover {
    background: #20ba5a;
}

.iw-interpretation {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.iw-interpretation h4 {
    color: #ffffff;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.iw-interpretation p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.6;
}

.iw-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

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

/* Loading Animation */
.iwc-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* Educational Content Styles */
.angle-seo-section {
    padding: 2rem 0;
}

.angle-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.angle-education-card h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.angle-education-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.angle-education-card p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.angle-education-card ul {
    margin-bottom: 1.5rem;
}

.angle-education-card li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.angle-education-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.angle-education-card a:hover {
    border-bottom-color: var(--primary);
}

/* Infographic Styles */
.infographic-conversion-formula {
    margin: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.formula-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 2px solid rgba(37, 99, 235, 0.2);
}

.formula-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.formula-content {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.formula-example {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .iw-card {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .ideal-weight-calculator-page {
        padding: 1rem 0;
    }

    .iw-main {
        padding: 1.5rem;
    }

    .iw-card {
        padding: 0;
        margin-bottom: 2rem;
    }

    .result-card {
        padding: 1.5rem;
    }

    .iw-title {
        font-size: 2rem;
    }

    .gender-group {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .iw-detailed-results {
        grid-template-columns: 1fr;
    }

    .copy-buttons-row {
        flex-direction: column;
    }

    .share-buttons {
        justify-content: flex-start;
    }

    .formula-visualization {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .iw-card,
    .result-card {
        padding: 1rem;
    }

    .field-input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .result-number {
        font-size: 2.5rem;
    }
}

