/**
 * Brotherhood Paper - Grain Decision Tool
 * Brand Colors:
 * - Dark Navy: #1B2130
 * - Gold: #D4AF37
 * - Beige: #E8E9EA
 * - Success/Hover: #6E815C
 */

/* ========================================
   Container & Reset
   ======================================== */
.bh-grain-tool-container {
    --bh-navy: #1B2130;
    --bh-gold: #D4AF37;
    --bh-beige: #E8E9EA;
    --bh-success: #6E815C;
    --bh-white: #FFFFFF;
    --bh-black: #000000;
    --bh-error: #C53030;
    --bh-warning: #DD6B20;
    --bh-info: #3182CE;
    
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    background: var(--bh-white);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(27, 33, 48, 0.12);
}

.bh-grain-tool-container *,
.bh-grain-tool-container *::before,
.bh-grain-tool-container *::after {
    box-sizing: border-box;
}

/* ========================================
   Locked State (Non-Members)
   ======================================== */
.bh-grain-locked-card {
    text-align: center;
    padding: 60px 40px;
    background: var(--bh-beige);
    border-radius: 12px;
}

.bh-locked-icon {
    color: var(--bh-navy);
    margin-bottom: 24px;
}

.bh-locked-icon svg {
    width: 64px;
    height: 64px;
}

.bh-locked-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--bh-navy);
    margin: 0 0 16px 0;
}

.bh-locked-message {
    font-size: 16px;
    color: #4A5568;
    margin: 0 0 32px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.bh-login-button {
    display: inline-block;
    padding: 14px 48px;
    background: var(--bh-gold);
    color: var(--bh-navy);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.bh-login-button:hover {
    background: var(--bh-success);
    color: var(--bh-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 129, 92, 0.4);
}

/* ========================================
   Tool Header
   ======================================== */
.bh-tool-header {
    text-align: center;
    padding: 24px 0 32px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--bh-beige);
}

.bh-tool-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--bh-navy);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.bh-tool-subtitle {
    font-size: 16px;
    color: #64748B;
    margin: 0;
}

/* ========================================
   Form Styles
   ======================================== */
.bh-grain-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bh-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.bh-form-group {
    display: flex;
    flex-direction: column;
}

.bh-form-group-full {
    grid-column: 1 / -1;
}

.bh-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--bh-navy);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bh-label-icon {
    font-size: 16px;
}

.bh-form-group select {
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--bh-beige);
    border-radius: 8px;
    background: var(--bh-white);
    color: var(--bh-navy);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231B2130' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

.bh-form-group select:hover {
    border-color: var(--bh-gold);
}

.bh-form-group select:focus {
    outline: none;
    border-color: var(--bh-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.bh-conditional-row {
    background: #FFF9E6;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--bh-gold);
}

.bh-conditional-row label {
    color: #92400E;
}

/* ========================================
   Form Actions
   ======================================== */
.bh-form-actions {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.bh-submit-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--bh-gold);
    color: var(--bh-navy);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bh-submit-button:hover {
    background: var(--bh-success);
    color: var(--bh-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 129, 92, 0.4);
}

.bh-submit-button:active {
    transform: translateY(0);
}

.bh-btn-icon {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.bh-submit-button:hover .bh-btn-icon {
    transform: translateX(4px);
}

.bh-reset-button {
    padding: 16px 24px;
    background: transparent;
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--bh-beige);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bh-reset-button:hover {
    border-color: var(--bh-navy);
    color: var(--bh-navy);
}

/* ========================================
   Results Section
   ======================================== */
.bh-results-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid var(--bh-beige);
}

.bh-results-header {
    text-align: center;
    margin-bottom: 28px;
}

.bh-results-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--bh-navy);
    margin: 0;
}

/* ========================================
   Info Message
   ======================================== */
.bh-info-message {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: #EBF8FF;
    border: 2px solid var(--bh-info);
    border-radius: 10px;
    margin-bottom: 24px;
}

.bh-info-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.bh-info-content {
    font-size: 15px;
    line-height: 1.6;
    color: #1A365D;
}

/* ========================================
   Decision Cards
   ======================================== */
.bh-decision-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.bh-decision-card {
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.bh-buy-card {
    background: #F0FDF4;
    border-color: var(--bh-success);
}

.bh-nobuy-card {
    background: #FEF2F2;
    border-color: var(--bh-error);
}

.bh-card-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bh-status-buy {
    background: var(--bh-success);
    color: var(--bh-white);
}

.bh-status-nobuy {
    background: var(--bh-error);
    color: var(--bh-white);
}

.bh-status-icon {
    font-size: 22px;
}

.bh-card-content {
    padding: 20px;
}

.bh-sheet-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--bh-navy);
    text-align: center;
    line-height: 1.4;
}

/* ========================================
   Risk Badge
   ======================================== */
.bh-risk-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
}

.bh-risk-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bh-risk-badge {
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bh-risk-badge.risk-low {
    background: #DCFCE7;
    color: #166534;
}

.bh-risk-badge.risk-medium {
    background: #FEF3C7;
    color: #92400E;
}

.bh-risk-badge.risk-medium-high {
    background: #FED7AA;
    color: #9A3412;
}

.bh-risk-badge.risk-high {
    background: #FECACA;
    color: #991B1B;
}

.bh-risk-badge.risk-critical {
    background: #991B1B;
    color: var(--bh-white);
}

/* ========================================
   Explanation Section
   ======================================== */
.bh-explanation-section {
    background: var(--bh-beige);
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.bh-explanation-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--bh-navy);
    margin: 0 0 12px 0;
}

.bh-explanation-section p {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    margin: 0;
}

/* ========================================
   Warning Section
   ======================================== */
.bh-warning-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: #FFFBEB;
    border: 2px solid var(--bh-warning);
    border-radius: 10px;
    margin-bottom: 24px;
}

.bh-warning-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.bh-warning-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: #92400E;
    margin: 0 0 8px 0;
}

.bh-warning-content p {
    font-size: 14px;
    line-height: 1.6;
    color: #78350F;
    margin: 0;
}

/* ========================================
   Summary Table
   ======================================== */
.bh-summary-section {
    background: var(--bh-navy);
    padding: 24px;
    border-radius: 10px;
}

.bh-summary-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--bh-gold);
    margin: 0 0 16px 0;
}

.bh-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.bh-summary-table td {
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bh-summary-table tr:last-child td {
    border-bottom: none;
}

.bh-summary-label {
    color: #94A3B8;
    width: 40%;
}

.bh-summary-value {
    color: var(--bh-white);
    font-weight: 500;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .bh-grain-tool-container {
        padding: 16px;
        margin: 0 12px;
    }
    
    .bh-tool-title {
        font-size: 22px;
    }
    
    .bh-form-row {
        grid-template-columns: 1fr;
    }
    
    .bh-form-actions {
        flex-direction: column;
    }
    
    .bh-reset-button {
        order: 1;
    }
    
    .bh-decision-cards {
        grid-template-columns: 1fr;
    }
    
    .bh-risk-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .bh-locked-card {
        padding: 40px 24px;
    }
}

@media (max-width: 480px) {
    .bh-tool-title {
        font-size: 20px;
    }
    
    .bh-tool-subtitle {
        font-size: 14px;
    }
    
    .bh-form-group select {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .bh-submit-button {
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* ========================================
   Animation
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bh-results-section.visible {
    animation: fadeIn 0.4s ease-out;
}

.bh-decision-card {
    animation: fadeIn 0.3s ease-out;
}

.bh-decision-card:nth-child(2) {
    animation-delay: 0.1s;
}
