/**
 * Band of Beans Discovery System Styles
 * Interactive nuggets spanning 1,000+ years of coffee's human story
 */

/* Discovery Nuggets - Inline Interactive Elements */
.discovery-nugget {
    position: relative;
    cursor: pointer;
    display: inline;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    padding: 2px 0;
}

.discovery-nugget:hover {
    background-color: rgba(126, 93, 76, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
}

.discovery-nugget .nugget-indicator {
    font-size: 0.8em;
    margin-left: 4px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.discovery-nugget:hover .nugget-indicator {
    opacity: 1;
    transform: scale(1.1);
}

/* Era-specific styling */
.discovery-nugget.ancient-era {
    border-bottom-color: #8B4513;
}

.discovery-nugget.ancient-era:hover {
    background-color: rgba(139, 69, 19, 0.1);
    box-shadow: 0 2px 4px rgba(139, 69, 19, 0.2);
}

.discovery-nugget.islamic-era {
    border-bottom-color: #DAA520;
}

.discovery-nugget.islamic-era:hover {
    background-color: rgba(218, 165, 32, 0.1);
    box-shadow: 0 2px 4px rgba(218, 165, 32, 0.2);
}

.discovery-nugget.colonial-era {
    border-bottom-color: #B22222;
}

.discovery-nugget.colonial-era:hover {
    background-color: rgba(178, 34, 34, 0.1);
    box-shadow: 0 2px 4px rgba(178, 34, 34, 0.2);
}

.discovery-nugget.modern-era {
    border-bottom-color: #228B22;
}

.discovery-nugget.modern-era:hover {
    background-color: rgba(34, 139, 34, 0.1);
    box-shadow: 0 2px 4px rgba(34, 139, 34, 0.2);
}

/* Discovery Modal Overlay */
.discovery-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.discovery-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Discovery Modal */
.discovery-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.discovery-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 16px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px 12px 0 0;
}

.discovery-era-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discovery-modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
    font-weight: 700;
}

.discovery-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.discovery-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* Discovery Content */
.discovery-content {
    padding: 0;
}

/* Discovery Tabs */
.discovery-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.discovery-tab {
    flex: 1;
    padding: 16px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.discovery-tab.active {
    color: #7E5D4C;
    background-color: #fff;
}

.discovery-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #7E5D4C;
}

.discovery-tab:hover:not(.active) {
    background-color: rgba(126, 93, 76, 0.05);
    color: #7E5D4C;
}

/* Discovery Panels */
.discovery-panels {
    min-height: 300px;
}

.discovery-panel {
    display: none;
    padding: 32px;
    line-height: 1.6;
}

.discovery-panel.active {
    display: block;
}

.discovery-panel .panel-icon {
    font-size: 2em;
    margin-bottom: 16px;
    text-align: center;
}

.discovery-panel p {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 16px;
}

.discovery-panel h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: #7E5D4C;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Curiosity Prompt */
.curiosity-prompt {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #7E5D4C;
}

.curiosity-prompt p {
    margin: 0;
    font-style: italic;
    color: #555;
}

/* Cultural and Colonial Connections */
.cultural-connection,
.colonial-connection {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #DAA520;
}

.colonial-connection {
    border-left-color: #B22222;
    background-color: #fdf8f8;
}

.modern-impact {
    background-color: #f0f8f0;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #228B22;
}

.research-credit {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.research-credit p {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

/* Discovery Footer */
.discovery-footer {
    background-color: #f8f9fa;
    padding: 24px 32px;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
}

.discovery-footer h4 {
    margin: 0 0 16px 0;
    color: #333;
    text-align: center;
    font-size: 1.1em;
}

/* Timeline Navigation */
.timeline-eras {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.era-nav {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    line-height: 1.3;
}

.era-nav span {
    display: block;
    font-size: 0.75em;
    font-weight: 400;
    margin-top: 4px;
    color: #999;
}

.era-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.era-nav.ancient:hover {
    border-color: #8B4513;
    background-color: rgba(139, 69, 19, 0.05);
}

.era-nav.islamic:hover {
    border-color: #DAA520;
    background-color: rgba(218, 165, 32, 0.05);
}

.era-nav.colonial:hover {
    border-color: #B22222;
    background-color: rgba(178, 34, 34, 0.05);
}

.era-nav.modern:hover {
    border-color: #228B22;
    background-color: rgba(34, 139, 34, 0.05);
}

/* Discovery Actions */
.discovery-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    align-items: center;
}

.discovery-share,
.discovery-explore {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.discovery-share {
    background-color: #7E5D4C;
    color: #fff;
    border: none;
    cursor: pointer;
}

.discovery-share:hover {
    background-color: #6a4e3d;
    transform: translateY(-1px);
}

.discovery-explore {
    background-color: #fff;
    color: #7E5D4C;
    border: 2px solid #7E5D4C;
}

.discovery-explore:hover {
    background-color: #7E5D4C;
    color: #fff;
    transform: translateY(-1px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .discovery-modal {
        width: 95vw;
        max-height: 90vh;
        margin: 20px;
    }
    
    .discovery-modal-header {
        padding: 16px 20px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .discovery-close {
        position: absolute;
        top: 16px;
        right: 20px;
    }
    
    .discovery-modal-header h3 {
        font-size: 1.3em;
        margin-top: 8px;
    }
    
    .discovery-panel {
        padding: 20px;
    }
    
    .discovery-tabs {
        flex-direction: column;
    }
    
    .discovery-tab {
        text-align: left;
    }
    
    .timeline-eras {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .era-nav {
        padding: 10px 6px;
        font-size: 0.8em;
    }
    
    .discovery-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .discovery-share,
    .discovery-explore {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .discovery-modal {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        margin: 0;
    }
    
    .discovery-modal-header {
        border-radius: 0;
    }
    
    .discovery-footer {
        border-radius: 0;
    }
    
    .timeline-eras {
        grid-template-columns: 1fr;
    }
}