/* =============================================
   Hemoglobin Improvement Planner – Modern UI
   ============================================= */

#hip-planner {
    padding: 2rem;
    border: none;
    border-radius: 12px;
    max-width: 90vw;
    width: 100%;
    margin: 2rem auto;
    background: linear-gradient(135deg, #fce4ec, #e8eaf6);
    box-sizing: border-box;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#hip-planner h3 {
    text-align: center;
    color: #424242;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
}

#hip-planner h3::before {
    content: "🩸";
    display: block !important;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.hip-intro {
    text-align: center;
    color: #616161;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

#hip-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hip-form-group {
    margin-bottom: 0;
}

.hip-form-group > label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    color: #616161;
}

.hip-required {
    color: #c62828;
    font-weight: bold;
}

.hip-form-group input[type="number"],
.hip-form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.hip-form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23616161' d='M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
    padding-right: 2.5rem;
    cursor: pointer;
}

.hip-form-group input[type="number"]:focus,
.hip-form-group select:focus {
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
    outline: none;
}

.hip-form-group input[type="number"]::placeholder {
    color: #9e9e9e;
    font-style: italic;
}

/* =============================================
   Radio Group Styling
   ============================================= */

.hip-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.hip-radio-label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: #424242;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
    font-weight: 400 !important;
    margin-bottom: 0 !important;
}

.hip-radio-label:hover {
    background-color: #fce4ec;
    border-color: #ef9a9a;
}

.hip-radio-label input[type="radio"] {
    width: auto !important;
    margin: 0 !important;
    accent-color: #c62828;
}

.hip-radio-label:has(input:checked) {
    background-color: #fce4ec;
    border-color: #c62828;
}

/* =============================================
   Checkbox Group Styling
   ============================================= */

.hip-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.hip-checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: #424242;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
    font-weight: 400 !important;
    margin-bottom: 0 !important;
}

.hip-checkbox-label:hover {
    background-color: #fce4ec;
    border-color: #ef9a9a;
}

.hip-checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
    accent-color: #c62828;
}

.hip-checkbox-label:has(input:checked) {
    background-color: #fce4ec;
    border-color: #c62828;
}

/* Trust Indicators */
.hip-trust-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    justify-content: center;
    padding: 0.75rem 0;
}

.hip-trust-indicators span {
    font-size: 0.85rem;
    color: #c62828;
    font-weight: 500;
    white-space: nowrap;
}

/* Cloudflare Turnstile */
#hip-planner .cf-turnstile {
    display: flex;
    justify-content: center;
}

/* Submit Button */
#hip-planner button[type="submit"] {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #c62828, #b71c1c);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

#hip-planner button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
}

#hip-planner button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================
   Result Card Styling
   ============================================= */

#hip-planner #hip-result {
    text-align: left;
    font-size: 1rem;
    margin-top: 1.5rem;
    padding: 0;
    border-radius: 8px;
    transition: all 0.3s;
}

#hip-planner #hip-result.has-result {
    padding: 1.25rem 1.5rem;
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: hip-fadeIn 0.5s ease-in;
}

#hip-planner #hip-result.error {
    background-color: #ffebee;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
    padding: 1rem 1.5rem;
    text-align: center;
    font-weight: bold;
    animation: hip-fadeIn 0.5s ease-in;
}

/* Hemoglobin Status Badge */
.hip-status-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.hip-status-normal {
    background-color: #c8e6c9;
    color: #1b5e20;
}

.hip-status-normal::before {
    content: "🟢 ";
}

.hip-status-low {
    background-color: #ffcdd2;
    color: #b71c1c;
}

.hip-status-low::before {
    content: "🔴 ";
}

.hip-status-verylow {
    background-color: #ffcdd2;
    color: #b71c1c;
}

.hip-status-verylow::before {
    content: "🔴 ";
}

/* Section Titles */
.hip-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hip-section-title:first-child {
    margin-top: 0;
}

.hip-section-title.hip-cause-title {
    color: #c62828;
}

.hip-section-title.hip-foods-title {
    color: #2e7d32;
}

.hip-section-title.hip-avoid-title {
    color: #e65100;
}

.hip-section-title.hip-timeline-title {
    color: #1565c0;
}

.hip-section-title.hip-tests-title {
    color: #37474f;
}

.hip-section-title.hip-tip-title {
    color: #6a1b9a;
}

/* Cause text */
.hip-cause-text {
    color: #424242;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    padding-left: 0.5rem !important;
    border-left: 3px solid #ef9a9a;
}

/* Foods list */
#hip-planner .hip-foods-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 0.5rem 0 !important;
}

#hip-planner .hip-foods-list li {
    padding: 0.4rem 0 0.4rem 1.75rem !important;
    position: relative;
    color: #424242;
    font-size: 0.95rem;
    list-style: none !important;
}

#hip-planner .hip-foods-list li::before {
    content: "✔";
    position: absolute;
    left: 0 !important;
    top: 0.4rem;
    color: #2e7d32;
    font-weight: bold;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
    font-size: 0.95rem;
    line-height: 1;
    width: 1.25rem;
    display: inline-block;
}

/* Avoid list */
#hip-planner .hip-avoid-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 0.5rem 0 !important;
}

#hip-planner .hip-avoid-list li {
    padding: 0.4rem 0 0.4rem 1.75rem !important;
    position: relative;
    color: #424242;
    font-size: 0.95rem;
    list-style: none !important;
}

#hip-planner .hip-avoid-list li::before {
    content: "✗";
    position: absolute;
    left: 0 !important;
    top: 0.4rem;
    color: #c62828;
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1;
    width: 1.25rem;
    display: inline-block;
}

/* Recovery Timeline */
.hip-timeline-text {
    color: #424242;
    font-size: 0.95rem;
    padding-left: 0.5rem !important;
    border-left: 3px solid #90caf9;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Suggested Tests list */
#hip-planner .hip-tests-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 0.5rem 0 !important;
}

#hip-planner .hip-tests-list li {
    padding: 0.3rem 0 0.3rem 1.75rem !important;
    position: relative;
    color: #424242;
    font-size: 0.95rem;
    list-style: none !important;
}

#hip-planner .hip-tests-list li::before {
    content: "•";
    position: absolute;
    left: 0.25rem !important;
    top: 0.3rem;
    color: #37474f;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
    width: 1.25rem;
    display: inline-block;
}

/* Diet Tip */
.hip-diet-tip {
    color: #424242;
    font-size: 0.95rem;
    padding-left: 0.5rem !important;
    border-left: 3px solid #ce93d8;
    margin-top: 0.25rem;
    font-style: italic;
}

/* =============================================
   Share Button
   ============================================= */

.hip-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: white !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hip-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
}

.hip-share-btn::before {
    content: "📤";
    font-size: 1rem;
}

.hip-share-copied {
    background: linear-gradient(135deg, #2e7d32, #1b5e20) !important;
}

/* Loading state */
#hip-planner #hip-result.loading {
    text-align: center;
    padding: 1rem;
    color: #616161;
    font-style: italic;
}

@keyframes hip-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   Mobile Responsiveness
   ============================================= */

@media (max-width: 768px) {
    #hip-planner {
        padding: 1rem;
        margin: 1rem auto;
        max-width: 95vw;
    }

    #hip-planner h3 {
        font-size: 1.25rem;
    }

    .hip-intro {
        font-size: 0.9rem;
    }

    .hip-form-group input[type="number"],
    .hip-form-group select {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .hip-radio-group,
    .hip-checkbox-group {
        gap: 0.35rem 0.5rem;
    }

    .hip-radio-label,
    .hip-checkbox-label {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }

    #hip-planner button[type="submit"] {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    #hip-result {
        font-size: 0.9rem;
    }

    .hip-trust-indicators {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    #hip-planner {
        padding: 0.75rem;
        margin: 0.75rem auto;
    }

    #hip-planner h3 {
        font-size: 1.1rem;
    }

    .hip-form-group > label {
        font-size: 0.9rem;
    }

    .hip-form-group input[type="number"],
    .hip-form-group select {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .hip-radio-label,
    .hip-checkbox-label {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    #hip-planner button[type="submit"] {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    #hip-result {
        font-size: 0.85rem;
    }
}
