/* Results Display - Mobile-First Magical UI */

/* Container for all results */
.results-section {
    padding: 0.75rem !important;
    max-width: 100% !important;
    background: linear-gradient(180deg, #E8F5E9 0%, #F1F8E9 100%);
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Main result card - Compact hero card */
.result-card {
    background: white !important;
    border-radius: 20px !important;
    padding: 1rem !important;
    margin: 0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Plant name - Compact but prominent */
#plantName {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #2E7D32 !important;
    text-align: center !important;
    margin: 0 !important;
    line-height: 1.1 !important;
}

/* Confidence and rarity bars container - Side by side */
.identification-stats {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    margin: 0 !important;
}

/* Confidence section - Compact */
.confidence-section,
.rarity-section {
    background: #f8f9fa !important;
    padding: 0.5rem !important;
    border-radius: 12px !important;
    text-align: center !important;
    flex: 1 !important;
}

/* Confidence/Rarity bars - Smaller */
.confidence-bar,
.rarity-bar {
    width: 100% !important;
    height: 28px !important;
    background: #e0e0e0 !important;
    border-radius: 14px !important;
    overflow: visible !important;
    position: relative !important;
    margin: 0 0 0.25rem 0 !important;
}

/* Bar fills */
.confidence-fill,
.rarity-fill {
    height: 100% !important;
    border-radius: 20px !important;
    transition: width 0.5s ease !important;
    position: relative !important;
}

.confidence-fill {
    background: linear-gradient(90deg, #4CAF50, #66BB6A) !important;
}

/* Confidence/Rarity text - centered in bar */
.confidence-text,
.rarity-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
    z-index: 1 !important;
    white-space: nowrap !important;
}

/* Stat labels - Smaller */
.stat-label {
    font-size: 0.75rem !important;
    color: #666 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

/* Plant details section - Hidden by default, show in Learn More */
#plantDetails {
    display: none !important;
}

#plantDetails h3 {
    font-size: 1.3rem !important;
    color: #333 !important;
    margin: 0 0 1rem 0 !important;
    font-weight: 600 !important;
}

#plantDetails p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    color: #555 !important;
    margin: 0 !important;
}

/* Care instructions - Compact card */
#plantCare {
    background: white !important;
    padding: 1rem !important;
    border-radius: 15px !important;
    margin: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

#plantCare h3 {
    font-size: 1.1rem !important;
    color: #333 !important;
    margin: 0 0 0.5rem 0 !important;
    font-weight: 600 !important;
}

.care-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
}

.care-item {
    background: #f8f9fa !important;
    padding: 0.5rem !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
}

.care-item strong {
    display: inline-block !important;
    margin-right: 0.5rem !important;
}

/* User choices section - Compact */
.user-choices {
    background: white !important;
    padding: 1rem !important;
    border-radius: 20px !important;
    margin: 0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    flex-shrink: 0;
}

.user-choices h3 {
    font-size: 1.1rem !important;
    text-align: center !important;
    margin: 0 0 0.75rem 0 !important;
    color: #333 !important;
    font-weight: 600 !important;
}

/* All choice buttons - Horizontal layout when possible */
.choice-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
}

/* Stack vertically if 3 buttons */
.choice-buttons:has(.btn-detailed) {
    grid-template-columns: 1fr !important;
}

.btn-choice {
    padding: 0.875rem 1rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    border: none !important;
    width: 100% !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 50px !important;
}

/* Yes button - Green */
.btn-choice.btn-accept {
    background: linear-gradient(135deg, #4CAF50, #66BB6A) !important;
    color: white !important;
}

.btn-choice.btn-accept:active {
    transform: scale(0.98) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

/* Override button - Orange/Red */
.btn-choice.btn-override {
    background: linear-gradient(135deg, #FF6B6B, #FF5252) !important;
    color: white !important;
}

.btn-choice.btn-override:active {
    transform: scale(0.98) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

/* Help me identify button - Orange */
.btn-choice.btn-detailed {
    background: linear-gradient(135deg, #FFA726, #FFB74D) !important;
    color: white !important;
}

.btn-choice.btn-detailed:active {
    transform: scale(0.98) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

/* Learn more section */
.learn-more-section {
    display: none !important;
}

#learnMoreBtn {
    background: linear-gradient(135deg, #2196F3, #42A5F5) !important;
    color: white !important;
    padding: 1rem 2rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 25px !important;
    box-shadow: 0 3px 15px rgba(33, 150, 243, 0.3) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#learnMoreBtn:active {
    transform: scale(0.98) !important;
}

/* Hide any orphaned or duplicate text */
.results-section > p,
.detective-container > p {
    display: none !important;
}

/* Plant Detective Results - Magical Reveal */
.detective-container {
    padding: 0.75rem !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Hide orphaned text */
.detective-container > p {
    display: none !important;
}

/* Result header with emoji */
.detective-result-header {
    text-align: center !important;
    margin-bottom: 0.75rem !important;
    background: white !important;
    padding: 1rem !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.detective-result-header h2 {
    font-size: 1.5rem !important;
    color: #2E7D32 !important;
    margin: 0 !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

.detective-result-header h2:before {
    content: "🕵️" !important;
    font-size: 1.75rem !important;
}

/* Success card for Plant Detective - Compact celebration */
.investigation-complete-card,
.detective-plant-result {
    background: white !important;
    border-radius: 20px !important;
    padding: 1rem !important;
    margin: 0 0 0.75rem 0 !important;
    text-align: center !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Add subtle gradient border */
.investigation-complete-card:before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #4CAF50, #66BB6A) !important;
}

/* Combine plant name and confidence in one view */
.detective-plant-result h3 {
    font-size: 1.75rem !important;
    color: #2E7D32 !important;
    margin: 0 0 0.25rem 0 !important;
    font-weight: 700 !important;
}

.detective-plant-result .scientific-name {
    font-size: 1rem !important;
    color: #666 !important;
    font-style: italic !important;
    margin: 0 0 0.75rem 0 !important;
}

/* Confidence bar with improvement inline */
.detective-confidence-display {
    background: #f8f9fa !important;
    padding: 0.75rem !important;
    border-radius: 15px !important;
    margin: 0 0 0.75rem 0 !important;
}

.detective-confidence-bar {
    width: 100% !important;
    height: 32px !important;
    background: #e0e0e0 !important;
    border-radius: 16px !important;
    position: relative !important;
    overflow: visible !important;
    margin: 0 0 0.5rem 0 !important;
}

.detective-confidence-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #4CAF50, #66BB6A) !important;
    border-radius: 16px !important;
    position: relative !important;
    transition: width 0.5s ease !important;
}

.detective-confidence-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.confidence-improvement-text {
    font-size: 0.9rem !important;
    color: #4CAF50 !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* Key features - Compact pill display */
.key-features-card {
    background: white !important;
    padding: 1rem !important;
    border-radius: 15px !important;
    margin: 0 0 0.75rem 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.key-features-card h4 {
    font-size: 1rem !important;
    color: #333 !important;
    margin: 0 0 0.5rem 0 !important;
    font-weight: 600 !important;
}

.features-pills {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
}

.feature-pill {
    background: #E8F5E9 !important;
    color: #2E7D32 !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
}

.feature-pill:before {
    content: "✓" !important;
    font-size: 0.9rem !important;
}

/* Hide the explanation text on mobile */
.detective-summary p {
    display: none !important;
}

/* Fix overflow and spacing issues */
* {
    box-sizing: border-box !important;
}

.results-section,
.detective-container {
    overflow-x: hidden !important;
}

/* Ensure proper stacking */
.result-card,
.user-choices,
.investigation-complete-card {
    position: relative !important;
    z-index: 1 !important;
}

/* Remove any extra margins on first/last elements */
.results-section > :first-child {
    margin-top: 0 !important;
}

.results-section > :last-child {
    margin-bottom: 0 !important;
}


/* Remove excessive bottom padding from user choices */
.user-choices {
    margin-bottom: 0 !important;
}

/* Make the entire detective results fit on one screen */
.detective-results {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 0 !important;
    background: transparent !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
}

/* Responsive font scaling for very small devices */
@media (max-width: 380px) {
    #plantName,
    .detective-plant-result h3 {
        font-size: 1.5rem !important;
    }
    
    .btn-choice {
        font-size: 0.95rem !important;
        padding: 0.75rem !important;
    }
    
    .care-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Ensure buttons don't overflow on small screens */
@media (max-width: 320px) {
    .btn-choice {
        font-size: 1rem !important;
        padding: 0.875rem 1rem !important;
        min-height: 55px !important;
    }
}