/* ==========================================
   Protein Calculator Specific Styles
   ========================================== */

.page-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.page-header .lead-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================================
   Calculator Container
   ========================================== */

.calculator-section {
    padding: 40px 0;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   Input Section
   ========================================== */

.input-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.input-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-with-unit:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-with-unit input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-with-unit input:focus {
    outline: none;
}

.input-with-unit .unit {
    padding: 14px 16px;
    background: #f8f9fa;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    border-left: 2px solid #dee2e6;
}

.select-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.radio-label:hover {
    background: rgba(74, 144, 226, 0.05);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

.radio-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ==========================================
   Results Section
   ========================================== */

.results-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.results-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-weight: 700;
}

.result-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-card.calories {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.05));
    border-color: #e74c3c;
}

.result-card.protein {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(52, 152, 219, 0.05));
    border-color: #3498db;
}

.result-card.carbs {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(243, 156, 18, 0.05));
    border-color: #f39c12;
}

.result-card.fat {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(46, 204, 113, 0.05));
    border-color: #2ecc71;
}

.result-icon {
    font-size: 2.5rem;
}

.result-content {
    flex: 1;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-unit {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ==========================================
   Macro Ratio
   ========================================== */

.macro-ratio {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.macro-ratio h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.ratio-bar {
    display: flex;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.ratio-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.ratio-segment:hover {
    filter: brightness(1.1);
}

.protein-seg {
    background: #3498db;
}

.carbs-seg {
    background: #f39c12;
}

.fat-seg {
    background: #2ecc71;
}

.ratio-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================
   BMR Info
   ========================================== */

.bmr-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
}

.bmr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bmr-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.bmr-value {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* ==========================================
   Calculation Section
   ========================================== */

.calculation-section {
    margin-top: 50px;
    padding: 40px 20px;
}

.calculation-section h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.calculation-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.step-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 25px;
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.formula {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
}

.formula-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Activity Table */
.activity-table {
    margin-top: 15px;
}

.activity-table table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th,
.activity-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.activity-table th {
    background: #f8f9fa;
    color: var(--text-primary);
    font-weight: 600;
}

.activity-table td:last-child {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

/* Macro Formulas */
.macro-formulas {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.macro-formula-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.macro-name {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 80px;
}

.macro-calc {
    flex: 1;
    font-family: 'Consolas', monospace;
    color: var(--text-primary);
}

.macro-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==========================================
   Guide Section
   ========================================== */

.guide-section {
    margin-top: 50px;
    padding: 40px 20px;
}

.guide-section h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.guide-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--primary-color);
}

.guide-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.guide-card p {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.guide-card strong {
    color: var(--primary-color);
}

.tips-box {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05), rgba(80, 200, 120, 0.05));
    padding: 30px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    margin-bottom: 30px;
}

.tips-box h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.tips-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-box ul li {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 15px;
    padding-left: 25px;
    position: relative;
}

.tips-box ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.tips-box ul li:last-child {
    margin-bottom: 0;
}

.warning-box {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.05), rgba(231, 76, 60, 0.02));
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #e74c3c;
}

.warning-box h3 {
    font-size: 1.2rem;
    color: #e74c3c;
    margin-bottom: 15px;
    font-weight: 700;
}

.warning-box p {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin: 0;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 1024px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .input-section,
    .results-section {
        padding: 20px;
    }

    .result-value {
        font-size: 1.6rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .step-card {
        flex-direction: column;
        padding: 20px;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .ratio-segment span {
        font-size: 0.8rem;
    }

    .activity-table {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 30px 15px;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .result-icon {
        font-size: 2rem;
    }

    .result-value {
        font-size: 1.4rem;
    }

    .calculation-section h2,
    .guide-section h2 {
        font-size: 1.6rem;
    }

    .macro-formula-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}