/* WHR Calculator Plugin Styles */
/* Brand Color: #16a34a (Green) */

/* Reset and Base Styles */
.whr-calculator-container * {
    box-sizing: border-box;
}

.whr-calculator-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #374151;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.whr-header {
    text-align: center;
    margin-bottom: 40px;
}

.whr-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #16a34a;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 4px rgba(22, 163, 74, 0.1);
}

.whr-description {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Main Layout */
.whr-main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Input Container */
.whr-input-container {
    display: flex;
    flex-direction: column;
}

.whr-input-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.whr-input-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.whr-input-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #16a34a;
    margin: 0 0 24px 0;
    text-align: center;
}

/* Form Styles */
.whr-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.whr-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whr-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whr-unit-display {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.9rem;
}

/* Radio Button Styles */
.whr-radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.whr-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    transition: color 0.2s ease;
}

.whr-radio-label:hover {
    color: #16a34a;
}

.whr-radio-label input[type="radio"] {
    display: none;
}

.whr-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.whr-radio-label input[type="radio"]:checked + .whr-radio-custom {
    border-color: #16a34a;
    background: #16a34a;
}

.whr-radio-label input[type="radio"]:checked + .whr-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Input Field Styles */
.whr-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.whr-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.whr-input:focus {
    outline: none;
    border-color: #16a34a;
    background: white;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.whr-input-icon {
    display: none; /* Hide icons to prevent text overlap */
}

.whr-help-text {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Calculate Button */
.whr-calculate-btn {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
}

.whr-calculate-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(22, 163, 74, 0.3);
}

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

.whr-calculate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.whr-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* Results Container */
.whr-results-container {
    display: flex;
    flex-direction: column;
}

.whr-results-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    animation: slideInUp 0.5s ease-out;
}

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

.whr-results-header {
    text-align: center;
    margin-bottom: 24px;
}

.whr-results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #16a34a;
    margin: 0;
}

/* WHR Value Display */
.whr-value-display {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

.whr-value-label {
    font-size: 0.9rem;
    color: #166534;
    font-weight: 500;
    margin-bottom: 8px;
}

.whr-value-number {
    font-size: 3rem;
    font-weight: 700;
    color: #16a34a;
    line-height: 1;
}

/* Risk Indicator */
.whr-risk-indicator {
    margin-bottom: 24px;
}

.whr-risk-badge {
    text-align: center;
    margin-bottom: 16px;
}

.whr-risk-level {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    background: #16a34a;
    transition: all 0.3s ease;
}

.whr-risk-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.whr-risk-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 4px;
    transition: all 0.5s ease;
    width: 0%;
}

/* Risk Colors */
.whr-risk-low {
    background: #16a34a !important;
}

.whr-risk-moderate {
    background: #eab308 !important;
}

.whr-risk-high {
    background: #dc2626 !important;
}

/* Risk Message */
.whr-risk-message {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #16a34a;
    margin-bottom: 24px;
    font-weight: 500;
}

/* Health Information */
.whr-health-info {
    background: #f0fdf4;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    margin-bottom: 24px;
}

.whr-health-title {
    color: #166534;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.whr-health-text {
    color: #166534;
    margin: 0;
    line-height: 1.6;
}

/* Reference Ranges */
.whr-reference-ranges {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.whr-reference-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
    text-align: center;
}

.whr-reference-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.whr-reference-item {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.whr-reference-item strong {
    display: block;
    margin-bottom: 12px;
    color: #374151;
    font-size: 0.95rem;
}

.whr-reference-range {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 2px 0;
    font-weight: 500;
}

.whr-reference-range.whr-low {
    background: #dcfce7;
    color: #166534;
}

.whr-reference-range.whr-moderate {
    background: #fef3c7;
    color: #92400e;
}

.whr-reference-range.whr-high {
    background: #fee2e2;
    color: #991b1b;
}

/* Placeholder */
.whr-placeholder {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    border: 2px dashed #d1d5db;
    color: #6b7280;
}

.whr-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.whr-placeholder-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.whr-placeholder-text {
    margin: 0;
    line-height: 1.6;
}

/* Educational Section */
.whr-education-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid #bbf7d0;
}

.whr-education-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    color: #16a34a;
    margin: 0 0 32px 0;
}

.whr-education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.whr-education-item {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.whr-education-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.whr-education-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.whr-education-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #16a34a;
    margin: 0 0 12px 0;
}

.whr-education-item p {
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whr-calculator-container {
        padding: 16px;
    }
    
    .whr-title {
        font-size: 2rem;
    }
    
    .whr-description {
        font-size: 1rem;
    }
    
    /* Stack layout on mobile */
    .whr-main-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .whr-input-card,
    .whr-results-card {
        padding: 24px;
    }
    
    .whr-radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .whr-reference-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .whr-education-section {
        padding: 24px;
    }
    
    .whr-education-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .whr-value-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .whr-calculator-container {
        padding: 12px;
    }
    
    .whr-title {
        font-size: 1.8rem;
    }
    
    .whr-input-card,
    .whr-results-card {
        padding: 20px;
    }
    
    .whr-calculate-btn {
        padding: 16px 24px;
        font-size: 1rem;
    }
    
    .whr-education-section {
        padding: 20px;
    }
    
    .whr-education-item {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .whr-calculator-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .whr-calculate-btn {
        display: none;
    }
    
    .whr-education-section {
        break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .whr-input {
        border-width: 3px;
    }
    
    .whr-calculate-btn {
        border: 2px solid #000;
    }
    
    .whr-risk-badge {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}