/* 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: 180px 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;
}

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

.timeline-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);
}

.timeline-container {
    padding: 2rem;
}

.timeline-container p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.timeline-events {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
}

.timeline-events::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #0066ff;
}

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

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

.timeline-event::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: #0066ff;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #0066ff;
}

.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.9rem;
    line-height: 1.5;
}

.timeline-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    min-height: 200px;
}

.timeline-content {
    display: none;
}

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

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

.timeline-content h4 {
    color: #0066ff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.timeline-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.timeline-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.timeline-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Brother Comparison Section */
.brother-comparison {
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comparison-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;
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.15);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
}

.brother-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
}

.brother-section.tiberius {
    border-left: 4px solid #dc3545;
}

.brother-section.gaius {
    border-left: 4px solid #28a745;
}

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

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

.brother-section h4 {
    color: #333;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.brother-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #666;
}

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

.showcase-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;
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.15);
}

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

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

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

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

.reform-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

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

/* Death Scene */
.death-scene {
    margin: 2rem 0;
    background: white;
    border: 1px solid #e9ecef;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.death-scene-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #dc3545;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

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

.scene-description {
    background: #f8f9fa;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.casualty-count {
    display: block;
    text-align: center;
    margin: 2rem auto;
    padding: 1.5rem;
    background: rgba(220, 53, 69, 0.05);
    border-radius: 12px;
    max-width: 300px;
}

.casualty-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #dc3545;
    display: block;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.casualty-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.75rem;
    font-weight: 500;
}

/* Scholarship Box */
.scholarship-box {
    margin: 2rem 0;
    background: white;
    border: 1px solid #e9ecef;
    border-left: 4px solid #6c757d;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.scholarship-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #6c757d;
}

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

.scholarship-content p {
    margin-bottom: 1rem;
}

/* Consequence Analysis */
.consequence-analysis {
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.consequence-title {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.2rem;
}

.consequence-content {
    padding: 2rem;
}

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

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

.consequence-item h4 {
    color: #495057;
    margin-bottom: 0.75rem;
}

.consequence-item p {
    color: #666;
    line-height: 1.5;
}

/* 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;
}

/* Impact Cards */
.impact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.impact-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

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

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

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

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

/* 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;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .reform-cards {
        grid-template-columns: 1fr;
    }
    
    .consequence-grid {
        grid-template-columns: 1fr;
    }
    
    .impact-cards {
        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;
    }
}
