/* Lesson 2-2 Specific Styles: Birth and Early Life */

/* Hero Theme Colours */
:root {
    --hero-primary: #dc3545;
    --hero-secondary: #c82333;
    --hero-accent: #ffd700;
    --hero-light: #f8d7da;
    --hero-gradient: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Family Tree Section */
.family-tree-section {
    margin-bottom: 3rem;
}

.family-tree-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.1);
    overflow: hidden;
    margin: 2rem 0;
    position: relative;
}

#family-tree-diagram {
    padding: 2rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
}

.tree-level {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
    position: relative;
}

.tree-level.parents-level {
    margin-bottom: 3rem;
}

.tree-level.children-level {
    gap: 2rem;
}

.child-group {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 200px;
}

.tree-node {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.tree-node.divine {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-colour: #ffd700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.tree-node.mortal {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-colour: #6c757d;
}

.tree-node.hero {
    background: var(--hero-gradient);
    border-colour: var(--hero-primary);
    colour: white;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    transform: scale(1.1);
}

.tree-node:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tree-node.hero:hover {
    transform: translateY(-5px) scale(1.15);
}

.tree-node.active {
    border-colour: white;
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.node-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.node-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.tree-node.hero .node-name {
    colour: white;
}

.node-title {
    font-size: 0.9rem;
    opacity: 0.8;
}

.tree-node.hero .node-title {
    colour: rgba(255, 255, 255, 0.9);
}

/* Timeline Section */
.timeline-section {
    margin-bottom: 3rem;
}

.timeline-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.1);
    overflow: hidden;
    margin: 2rem 0;
}

#timeline-events {
    padding: 2rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    position: relative;
}

#timeline-events::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 3rem;
    bottom: 3rem;
    width: 3px;
    background: linear-gradient(180deg, var(--hero-primary) 0%, var(--hero-secondary) 100%);
}

.timeline-event {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 4rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-event:hover {
    transform: translateX(10px);
}

.event-marker {
    position: absolute;
    left: 0.75rem;
    width: 40px;
    height: 40px;
    background: white;
    border: 3px solid var(--hero-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-event.active .event-marker {
    background: var(--hero-primary);
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0.2);
}

.event-content {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid var(--hero-primary);
    transition: all 0.3s ease;
}

.timeline-event:hover .event-content {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.event-title {
    font-weight: 600;
    colour: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.event-description {
    colour: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    display: none;
}

.timeline-event.active .event-description {
    display: block;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease;
}

/* Serpent Battle Section */
.serpent-section {
    margin-bottom: 3rem;
}

.serpent-battle-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 16px;
    padding: 2rem;
    colour: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 2rem 0;
}

.serpent-battle {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 2rem 0;
    min-height: 150px;
}

.serpent {
    font-size: 4rem;
    transition: all 0.5s ease;
    cursor: pointer;
    animation: slither 2s ease-in-out infinite;
}

@keyframes slither {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.serpent.defeated {
    opacity: 0.3;
    transform: rotate(180deg) translateY(50px);
    animation: none;
}

.baby-heracles {
    font-size: 3rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.battle-button {
    background: var(--hero-primary);
    colour: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.battle-button:hover {
    background: var(--hero-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.battle-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: none;
    line-height: 1.6;
}

.battle-result.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Education Section */
.education-section {
    margin-bottom: 3rem;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.education-card {
    background: white;
    border: 3px solid rgba(220, 53, 69, 0.1);
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hero-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.education-card:hover::before {
    transform: scaleX(1);
}

.education-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(220, 53, 69, 0.2);
    border-colour: var(--hero-primary);
}

.education-card.active {
    border-colour: var(--hero-primary);
    background: linear-gradient(135deg, #fff0f0 0%, #ffffff 100%);
    box-shadow: 0 12px 35px rgba(220, 53, 69, 0.25);
    transform: translateY(-5px);
}

.education-card.active::before {
    transform: scaleX(1);
}

.education-card.tragic {
    border-colour: rgba(108, 117, 125, 0.2);
}

.education-card.tragic:hover {
    border-colour: #6c757d;
}

.education-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.education-card:hover .education-icon {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.education-title {
    colour: var(--hero-primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.education-teacher {
    colour: var(--hero-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.education-description {
    colour: #666;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Madness Section */
.madness-section {
    margin-bottom: 3rem;
}

.madness-container {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-radius: 16px;
    padding: 2rem;
    colour: white;
    margin: 2rem 0;
}

.madness-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.madness-container > p {
    text-align: center;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.madness-stages {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.madness-stage {
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: centre;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0.5rem;
    text-align: centre;
}

.madness-stage:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.madness-stage.active {
    background: var(--hero-gradient);
    border-colour: var(--hero-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
}

.madness-description {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    min-height: 100px;
    line-height: 1.7;
}

/* Interactive Text Elements */
.key-term {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    color: #856404;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.key-term:hover {
    background: linear-gradient(135deg, #ffeaa7 0%, #ffd93d 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 193, 7, 0.3);
}

.key-figure {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid var(--hero-primary);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    color: #721c24;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.key-figure:hover {
    background: linear-gradient(135deg, #f5c6cb 0%, #f1b0b7 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
}

.key-place {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #17a2b8;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    color: #0c5460;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.key-place:hover {
    background: linear-gradient(135deg, #bee5eb 0%, #9dd7e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(23, 162, 184, 0.3);
}

/* Primary Source Quotes */
.primary-source {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 5px solid var(--hero-primary);
    padding: 2rem;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 0 12px 12px 0;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.primary-source::before {
    content: '"';
    font-size: 4rem;
    color: var(--hero-primary);
    position: absolute;
    top: -10px;
    left: 15px;
    opacity: 0.3;
    font-family: serif;
}

.source-citation {
    font-size: 0.9rem;
    color: var(--hero-secondary);
    margin-top: 1.5rem;
    font-weight: 600;
    font-style: normal;
}

/* Detail Box */
.detail-box {
    background: linear-gradient(135deg, #fff0f0 0%, #ffffff 100%);
    border: 2px solid rgba(220, 53, 69, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    animation: fadeInUp 0.3s ease;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.08);
}

.detail-box h4 {
    color: var(--hero-primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    border-bottom: 2px solid rgba(220, 53, 69, 0.2);
    padding-bottom: 0.5rem;
}

.detail-box h5 {
    color: var(--hero-secondary);
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.1rem;
}

.detail-box p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.detail-box ul {
    margin-left: 1.5rem;
    color: #555;
}

.detail-box li {
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Content Sections */
.conception-section,
.hera-section,
.adulthood-section {
    margin-bottom: 3rem;
}

.conception-section h4,
.hera-section h4,
.education-section h4,
.adulthood-section h4,
.madness-section h4 {
    color: #495057;
    font-size: 1.2rem;
    margin: 2rem 0 1rem 0;
}

.conception-section p,
.hera-section p,
.education-section p,
.adulthood-section p,
.madness-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #333;
}

.conception-section ul,
.hera-section ul,
.adulthood-section ul,
.madness-section ul {
    margin: 1rem 0;
    padding-left: 2.5rem;
}

.conception-section li,
.hera-section li,
.adulthood-section li,
.madness-section li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

/* Summary Section */
.summary-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid rgba(220, 53, 69, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 3rem 0;
    position: relative;
}

.summary-section::before {
    content: '🏆';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    opacity: 0.3;
}

.summary-section h3 {
    color: var(--hero-primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.summary-section p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.summary-section ul {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.summary-section li {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #555;
}

.summary-section li strong {
    color: var(--hero-primary);
}

/* Sample elements in sidebar */
.sample-term {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #856404;
}

.sample-figure {
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #721c24;
}

.sample-place {
    background: #d1ecf1;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #0c5460;
}

/* Info Panel Content */
#info-content {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 1rem;
}

#info-content h4 {
    color: var(--hero-primary);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

#info-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    
    .left-sidebar {
        display: flex;
        gap: 3rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }
    
    .right-sidebar {
        position: relative;
        top: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .right-sidebar {
        grid-template-columns: 1fr;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
    }
    
    .madness-stages {
        grid-template-columns: 1fr;
    }
    
    .tree-level {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .tree-node {
        min-width: 200px;
    }
    
    .timeline-event {
        padding-left: 3rem;
    }
    
    #timeline-events::before {
        left: 1rem;
    }
    
    .event-marker {
        left: 0;
    }
    
    .serpent-battle {
        flex-direction: column;
        gap: 2rem;
    }
    
    .serpent,
    .baby-heracles {
        font-size: 3rem;
    }
}
