/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0066ff 0%, #4d94ff 25%, #e6f0ff 60%, #ffffff 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    color: #333;
}

/* Floating Background Shapes */
.bg-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 102, 255, 0.05);
    animation: float 20s infinite ease-in-out;
}

.shape1 {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.shape2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
    background: rgba(0, 102, 255, 0.03);
}

.shape3 {
    width: 250px;
    height: 250px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Global Info Button */
.global-info-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
    color: #0066ff;
}

.global-info-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.2);
}

/* Header */
.header {
    position: relative;
    z-index: 10;
    padding: 3rem 2rem 2rem;
    text-align: center;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #e6f0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -3px;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.logo a {
    text-decoration: none;
    background: linear-gradient(135deg, #ffffff 0%, #e6f0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.author {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

/* Main Dashboard Layout */
.dashboard-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 5;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 140px 1fr 280px;
    gap: 1.25rem;
    align-items: start;
}

/* Left Sidebar */
.left-sidebar {
    padding-top: 1rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.nav-link-sidebar {
    display: block;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
    margin-left: -0.5rem;
}

.nav-link-sidebar:hover {
    color: white;
    border-left-color: white;
}

.nav-link-sidebar.current {
    color: white;
    border-left-color: white;
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.content-header {
    background: white;
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.topic-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.section-intro {
    background: rgba(0, 102, 255, 0.05);
    border: 1px solid rgba(0, 102, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.section-intro h3 {
    color: #0066ff;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Content Body */
.content-body {
    padding: 2rem;
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
}

.content-section h3 {
    color: #0066ff;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f8f9fa;
}

.content-section h4 {
    color: #495057;
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem 0;
}

.content-section p,
.section-intro p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.content-section ul {
    margin: 1.5rem 0;
    padding-left: 2.5rem;
}

.content-section li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #333;
}

/* Interactive Content Styling */
.key-term {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #856404;
    cursor: pointer;
    transition: all 0.2s ease;
}

.key-term:hover {
    background: #ffeaa7;
    transform: translateY(-1px);
}

.key-figure {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #0c5460;
    cursor: pointer;
    transition: all 0.2s ease;
}

.key-figure:hover {
    background: #bee5eb;
    transform: translateY(-1px);
}

.key-concept {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #155724;
    cursor: pointer;
    transition: all 0.2s ease;
}

.key-concept:hover {
    background: #c3e6cb;
    transform: translateY(-1px);
}

/* Primary Sources */
.primary-source {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.primary-source::before {
    content: '"';
    font-size: 4rem;
    color: #6c757d;
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
}

.source-citation {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 1rem;
    font-weight: 600;
    font-style: normal;
}

/* Reform Showcase */
.reform-showcase {
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.explorer-header {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.75) 0%, rgba(77, 148, 255, 0.75) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 102, 255, 0.3);
    color: white;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.15);
}

.explorer-content {
    padding: 2rem;
}

.reform-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.reform-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.reform-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    background: #fff;
}

.reform-card.active {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 102, 255, 0.2);
    background: #fff;
    border-color: #0066ff;
}

.reform-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.reform-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0066ff;
    margin-bottom: 0.5rem;
}

.reform-subtitle {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Reform and Timeline Details Panel */
.reform-details, .timeline-details, .conflict-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    min-height: 300px;
    border: 2px solid #e9ecef;
}

.reform-content, .timeline-content, .conflict-content {
    display: none;
}

.reform-content.active, .timeline-content.active, .conflict-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.reform-content h4, .timeline-content h4, .conflict-content h4 {
    color: #0066ff;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.reform-content p, .timeline-content p, .conflict-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.reform-content ul, .timeline-content ul, .conflict-content ul {
    margin: 1.5rem 0;
    padding-left: 2.5rem;
}

.reform-content li, .timeline-content li, .conflict-content li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #333;
}

/* Cimbric Timeline */
.cimbric-timeline {
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.timeline-events {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.timeline-event {
    flex: 1;
    min-width: 200px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.timeline-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #0066ff;
    background: #fff;
}

.timeline-event.active {
    border-color: #0066ff;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.timeline-date {
    font-weight: 600;
    color: #0066ff;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Rivalry Showcase */
.rivalry-showcase {
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rival-profiles {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: center;
}

.rival-profile {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.rival-profile.marius {
    border-left-color: #28a745;
}

.rival-profile.sulla {
    border-left-color: #dc3545;
}

.rival-portrait {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    object-fit: cover;
    border: 3px solid #6c757d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.rival-portrait-fallback {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    background: linear-gradient(135deg, #6c757d, #5a6268);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    border: 3px solid #6c757d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.rival-profile h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.rival-profile p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
    font-size: 0.9rem;
}

.versus-symbol {
    font-size: 2rem;
    font-weight: bold;
    color: #dc3545;
    background: white;
    border: 3px solid #dc3545;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    justify-self: center;
}

.conflict-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.conflict-stage {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.conflict-stage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #dc3545;
    background: #fff;
}

.conflict-stage.active {
    border-color: #dc3545;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.stage-title {
    font-weight: 600;
    color: #dc3545;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.stage-description {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Beard Analysis Style */
.beard-analysis {
    margin: 2rem 0;
    background: white;
    border: 1px solid #e9ecef;
    border-left: 4px solid #e83e8c;
    border-radius: 8px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.beard-analysis::before {
    content: "📚";
    font-size: 1.5rem;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    opacity: 0.6;
}

.beard-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e83e8c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.beard-content {
    line-height: 1.6;
    color: #333;
}

.beard-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Consequence Grid */
.consequence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.consequence-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
}

.consequence-item h4 {
    color: #0066ff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.consequence-item p {
    color: #333;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Assessment Prompt */
.assessment-prompt {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #ffc107;
}

.assessment-prompt h4 {
    color: #856404;
    margin-bottom: 1rem;
}

.assessment-prompt p {
    color: #856404;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.assessment-prompt strong {
    color: #856404;
}

/* Navigation */
.topic-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-civ-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-civ-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
}

.btn-civ {
    background: linear-gradient(135deg, #0066ff 0%, #4d94ff 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 102, 255, 0.2);
}

.btn-civ:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.3);
    color: white;
}

/* Right Sidebar */
.right-sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar-content {
    display: none;
}

.sidebar-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0066ff;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: rgba(0, 0, 0, 0.5);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close:hover {
    color: rgba(0, 0, 0, 0.8);
}

.modal-header {
    background: linear-gradient(135deg, #0066ff 0%, #4d94ff 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    display: flex;
    padding: 2rem;
    gap: 2rem;
    align-items: center;
}

.modal-text {
    flex: 1;
}

.modal-text p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
}

.modal-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-footer {
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.contact-items {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    padding: 1rem;
    background: rgba(0, 102, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(0, 102, 255, 0.1);
}

.contact-icon {
    font-size: 1.25rem;
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 0.25rem;
}

.contact-value {
    font-weight: 600;
    color: #0066ff;
}

.modal-signature {
    text-align: center;
    color: rgba(0, 0, 0, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .left-sidebar {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        padding: 1rem;
        display: flex;
        gap: 2rem;
        order: -1;
    }

    .nav-section {
        margin-bottom: 0;
    }

    .right-sidebar {
        position: relative;
        top: 0;
        order: 2;
    }

    .reform-cards, .timeline-events, .conflict-stages {
        grid-template-columns: 1fr;
    }
    
    .rival-profiles {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .versus-symbol {
        order: 2;
        margin: 1rem auto;
    }
    
    .consequence-grid {
        grid-template-columns: 1fr;
    }

    .topic-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .topic-title {
        font-size: 1.5rem;
    }

    .logo {
        font-size: 3rem;
    }

    .modal-body {
        flex-direction: column;
        text-align: center;
    }

    .contact-items {
        flex-direction: column;
    }
}
