/* A1C Calculator Styles */
.a1c-calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Hero Section */
.calc-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.calc-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.calc-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.calc-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Calculator Section */
.calc-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.calc-input-area {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.calc-input-area h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group small {
    display: block;
    color: #7f8c8d;
    margin-top: 5px;
    font-size: 0.9rem;
}

.unit-selector {
    margin-bottom: 25px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: normal;
}

.calc-btn {
    width: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Results Section */
.calc-results {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-main {
    font-size: 3rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 15px 0;
}

.result-category {
    font-size: 1.3rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

.chart-container {
    margin: 30px 0;
    height: 300px;
    position: relative;
}

.result-analysis {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

/* Expert Insights Section */
.expert-insights {
    background: linear-gradient(135deg, #e8eaf6 0%, #f3e5f5 100%);
    border: 2px solid #d1c4e9;
    border-radius: 15px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

.expert-insights h3 {
    color: #5e35b1;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.insight-content p {
    color: #2c3e50;
    line-height: 1.8;
    margin-bottom: 18px;
    font-size: 1.05rem;
    text-align: justify;
}

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

/* Educational Content */
.calc-education {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.education-tabs {
    display: flex;
    background: #f1f3f4;
}

.tab-btn {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.tab-content > p {
    color: #34495e;
    line-height: 1.7;
    margin-bottom: 20px;
    text-align: justify;
}

.ranges-intro, .tips-intro, .foods-intro {
    margin-bottom: 25px;
}

.ranges-intro p, .tips-intro p, .foods-intro p {
    color: #34495e;
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: justify;
}

.info-grid, .tips-grid, .foods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card, .tip-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.info-card p, .tip-card p {
    color: #34495e;
    line-height: 1.6;
    margin: 0;
}

.tip-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.ranges-table {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.range-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 10px;
    gap: 10px;
}

.range-label {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

.range-value {
    font-weight: 600;
    font-size: 1.3rem;
}

.range-desc {
    font-weight: 400;
    line-height: 1.6;
    color: #34495e;
}

.range-item.normal {
    background: #d4edda;
    border-left: 5px solid #28a745;
}

.range-item.prediabetes {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
}

.range-item.diabetes {
    background: #f8d7da;
    border-left: 5px solid #dc3545;
}

.range-item.target {
    background: #d1ecf1;
    border-left: 5px solid #17a2b8;
}

.food-category {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.food-category.good {
    border-left: 5px solid #28a745;
}

.food-category.limit {
    border-left: 5px solid #dc3545;
}

.food-category h5 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.food-category p {
    color: #34495e;
    line-height: 1.6;
    margin: 0;
}

.food-category ul {
    margin-top: 15px;
    padding-left: 20px;
}

.food-category li {
    margin-bottom: 5px;
}

/* Call to Action */
.calc-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.calc-cta h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.cta-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cta-btn.primary {
    background: white;
    color: #667eea;
}

.cta-btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-btn:hover {
    transform: translateY(-2px);
}

/* Disclaimer */
.calc-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.calc-disclaimer p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .calc-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .calc-hero h2 {
        font-size: 2rem;
    }
    
    .calc-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .education-tabs {
        flex-direction: column;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .range-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 5px;
    }
    
    .info-grid, .tips-grid, .foods-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

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

/* Result Categories */
.result-category.normal { background: #d4edda; color: #155724; }
.result-category.prediabetes { background: #fff3cd; color: #856404; }
.result-category.diabetes { background: #f8d7da; color: #721c24; }