/* ==============================================
   Ingredient Checker Page - ingredient-checker.css
   ============================================== */

/* Page container */
.ic-page-container {
    background: #faf9f7;
    padding-bottom: 60px;
}

.ic-main-container {
    padding-top: 56px;
    padding-bottom: 40px;
}

/* Two-column grid */
.ic-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

/* Prevent CSS Grid children from overflowing their cell (min-width:auto default) */
.ic-left-col,
.ic-right-col {
    min-width: 0;
    overflow: hidden;
}

/* ---- Left Column ---- */

/* Input Section */
.ic-input-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.ic-paste-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #2c2c2c;
    margin-bottom: 12px;
}

.ic-label-hint {
    font-weight: 400;
    color: #6e6e6e;
    font-size: 14px;
}

.ic-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #e0dcd6;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: #4a4a4a;
    background: #faf9f7;
    resize: vertical;
    min-height: 160px;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.6;
    box-sizing: border-box;
}

.ic-textarea:focus {
    border-color: #696dac;
}

.ic-textarea::placeholder {
    color: #b0a89e;
}

.ic-analyze-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    background: #696dac;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.25s;
    letter-spacing: 0.2px;
}

.ic-analyze-btn:hover {
    background: #565a8c;
}

/* Results area */
.ic-results-area {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.ic-results-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #2c2c2c;
    margin-bottom: 16px;
}

.ic-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ic-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.ic-result-name {
    color: #2c2c2c;
}

.ic-result-badge {
    font-weight: 600;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 999px;
}

.ic-result-safe {
    background: #e8f5e9;
}

.ic-result-safe .ic-result-name {
    color: #1b5e20;
}

.ic-result-safe .ic-result-badge {
    background: #c8e6c9;
    color: #2e7d32;
}

.ic-result-caution {
    background: #fff8e1;
}

.ic-result-caution .ic-result-name {
    color: #4e2c00;
}

.ic-result-caution .ic-result-badge {
    background: #ffe0b2;
    color: #e65100;
}

.ic-result-avoid {
    background: #ffebee;
}

.ic-result-avoid .ic-result-name {
    color: #4a0000;
}

.ic-result-avoid .ic-result-badge {
    background: #ffcdd2;
    color: #c62828;
}

/* Result row inner layout for API results */
.ic-result-row {
    align-items: flex-start;
}

.ic-result-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.ic-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.ic-result-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #9e8a7a;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 999px;
}

.ic-result-desc {
    font-size: 12px;
    color: #7a6a60;
    font-style: italic;
    line-height: 1.4;
    width: 100%;
}

/* Summary line */
.ic-result-summary {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: #5a5a5a;
    padding: 10px 14px;
    background: #f5f2ee;
    border-radius: 6px;
    margin-bottom: 4px;
}

/* Disabled/loading button state */
.ic-analyze-btn:disabled {
    background: #9a9dc9;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Promo card */
.ic-promo-card {
    background: #f5f2ee;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ic-promo-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #2c2c2c;
    margin-bottom: 8px;
}

.ic-promo-desc {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #6e6e6e;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ic-promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: #696dac;
    color: #ffffff;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.25s;
}

.ic-promo-btn:hover {
    background: #565a8c;
    color: #fff;
}

/* ---- Right Column ---- */

/* Legend card */
.ic-legend-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.ic-legend-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 20px;
}

.ic-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.ic-legend-item:last-child {
    margin-bottom: 0;
}

.ic-legend-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.ic-legend-status {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 3px;
}

.ic-status-safe {
    color: #2e7d32;
}

.ic-status-caution {
    color: #e65100;
}

.ic-status-avoid {
    color: #c62828;
}

.ic-legend-desc {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6e6e6e;
    line-height: 1.5;
}

/* Pro Tips card */
.ic-tips-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ic-tips-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 16px;
}

.ic-tips-list {
    list-style: disc;
    padding-left: 18px;
    margin: 0;
}

.ic-tips-list li {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #4a4a4a;
    margin-bottom: 10px;
    line-height: 1.5;
}

.ic-tips-list li:last-child {
    margin-bottom: 0;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .ic-grid {
        grid-template-columns: 1fr;
    }

    .ic-right-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .ic-legend-card,
    .ic-tips-card {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    /* Mobile-optimized result rows */
    .ic-result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
        border-left: 4px solid transparent;
        position: relative;
    }
    
    /* Add status color border for better mobile visibility */
    .ic-result-safe {
        border-left-color: #2e7d32;
    }
    
    .ic-result-caution {
        border-left-color: #e65100;
    }
    
    .ic-result-avoid {
        border-left-color: #c62828;
    }
    
    /* Make ingredient name larger on mobile */
    .ic-result-name {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    /* Style metadata better for mobile */
    .ic-result-meta {
        margin-top: 8px;
    }
    
    .ic-result-category {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .ic-result-desc {
        font-size: 13px;
        margin-top: 4px;
        line-height: 1.4;
    }
    
    /* Make badge more prominent on mobile */
    .ic-result-badge {
        font-size: 14px;
        font-weight: 700;
        padding: 6px 14px;
        align-self: flex-start;
    }
    
    /* Increase gap between result rows on mobile */
    .ic-results-list {
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .ic-right-col {
        grid-template-columns: 1fr;
    }

    .ic-main-container {
        padding-top: 32px;
    }

    .ic-input-section,
    .ic-promo-card {
        padding: 20px;
    }
    
    /* Further optimize for very small screens */
    .ic-result-row {
        padding: 14px;
        border-radius: 8px;
    }
    
    .ic-results-area {
        padding: 20px;
    }
    
    .ic-result-summary {
        font-size: 14px;
        padding: 12px 14px;
        text-align: center;
        margin-bottom: 8px;
    }
}

/* Extra small screens optimization */
@media (max-width: 360px) {
    .ic-input-section,
    .ic-promo-card,
    .ic-legend-card,
    .ic-tips-card {
        padding: 16px;
    }
    
    .ic-textarea {
        min-height: 120px;
        font-size: 14px;
    }
    
    .ic-analyze-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .ic-result-name {
        font-size: 15px;
    }
    
    .ic-result-badge {
        font-size: 12px;
        padding: 5px 12px;
    }
    
    .ic-legend-title,
    .ic-tips-title {
        font-size: 16px;
    }
}