/**
 * Nutrition Facts - Minimal Structural CSS
 * Inherits colors and fonts from WordPress theme
 * Defines layout structure + visual separation (backgrounds, borders, shadows)
 */

/* === SEARCH SECTION === */
.nf-search {
    max-width: 600px;
    margin: 0 auto 2em;
    position: relative;
}

#nf-search-input {
    width: 100%;
    box-sizing: border-box;
}

/* === SUGGESTIONS DROPDOWN === */
.nf-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    
    /* Visual separation */
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-top: 4px;
}

.nf-suggestions.show {
    display: block;
}

.nf-suggestion-item {
    padding: 0.75em 1em;
    cursor: pointer;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nf-suggestion-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nf-suggestion-item:last-child {
    border-bottom: none;
}

/* === QUANTITY EDITOR === */
.nf-quantity-field {
    border: none;
    border-bottom: 1px solid currentColor;
    background: transparent;
    outline: none;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
}

.nf-quantity-field:focus {
    border-bottom-width: 2px;
}

/* Remove number input arrows - Cross-browser */
.nf-quantity-field::-webkit-inner-spin-button,
.nf-quantity-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nf-quantity-field {
    -moz-appearance: textfield;
}

/* === FOOD CARD === */
.nf-food-card {
    max-width: 900px;
    margin: 0 auto;
    
    /* Visual separation */
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* === NUTRIENTS GRID === */
.nf-nutrients {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1em;
    margin-top: 1em;
}

.nf-nutrient-item {
    padding: 1em;
    
    /* Visual separation - works on any background */
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.nf-nutrient-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5em;
    opacity: 0.7;
}

.nf-nutrient-value {
    font-size: 1.25em;
    font-weight: 600;
}

/* === PAYWALL === */
.nf-paywall {
    padding: 2em;
    text-align: center;
    margin-top: 2em;
    
    /* Visual separation */
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.nf-paywall .nf-btn-contribute,
.nf-paywall .nf-btn-academic {
    display: inline-block;
    margin: 0.5em;
}

.nf-paywall .nf-disclaimer {
    margin-top: 1em;
    font-size: 0.875em;
    opacity: 0.8;
}

/* === ACADEMIC REQUEST FORM === */
.nf-academic-form {
    max-width: 600px;
    margin: 0 auto;
    
    /* Visual separation */
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nf-academic-form label {
    display: block;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.nf-academic-form input,
.nf-academic-form textarea {
    width: 100%;
    box-sizing: border-box;
}

.nf-academic-form small {
    display: block;
    margin-top: 0.25em;
    margin-bottom: 1em;
    font-size: 0.875em;
    opacity: 0.7;
}

.nf-academic-form .nf-btn-submit {
    margin-top: 1.5em;
    width: 100%;
}

/* === SUCCESS/ERROR MESSAGES === */
.nf-success-message {
    padding: 1.5em;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    
    /* Visual separation */
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-left: 6px solid #4caf50;
    border-radius: 6px;
}

.nf-error {
    padding: 1em;
    margin-bottom: 1em;
    
    /* Visual separation */
    background: rgba(244, 67, 54, 0.1);
    border: 2px solid rgba(244, 67, 54, 0.3);
    border-left: 6px solid #f44336;
    border-radius: 6px;
}

/* === LOADING STATE === */
.nf-loading {
    text-align: center;
    padding: 2em;
    opacity: 0.7;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nf-nutrients {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .nf-food-card,
    .nf-academic-form {
        padding: 1.5em;
    }
    
    .nf-paywall .nf-btn-contribute,
    .nf-paywall .nf-btn-academic {
        display: block;
        margin: 0.5em 0;
    }
}