/* General Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #2c3e50;
    color: #333;
}

/* Header Component */
.app-header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.app-header p {
    margin: 5px 0 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.lang-select {
    background-color: #34495e;
    color: white;
    border: 1px solid #4e6d8c;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.lang-select:hover, .lang-select:focus {
    background-color: #4e6d8c;
    border-color: #5d80a4;
}

.lang-select option {
    background-color: #2c3e50;
    color: white;
}

h2 {
    color: #2c3e50;
}

/* Main Container */
.main-layout {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Instructions area */
.controls-hint {
    margin-top: 15px;
    padding: 10px;
    background-color: #e8ecef;
    border-left: 4px solid #3498db;
    font-size: 0.85rem;
    color: #555;
    border-radius: 0 4px 4px 0;
}

/* Bottom Ad Container */
.ad-bottom {
    margin-top: 20px;
    text-align: center;
    min-height: 100px;
    /* Reserves space to minimize layout shift */
}

#visualization {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    /* Blend the image with a white overlay to keep it subtle */
    background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), url('img/worldmap.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

/* Standard bar styling */
.vis-item {
    border-radius: 4px;
    border-color: #3498db;
    background-color: #ebf5fb;
    font-size: 12px;
    cursor: pointer;
}

/* Styling when you click a person (Highlighter) */
.vis-item.highlight-contemporary {
    background-color: #f1c40f !important;
    border-color: #f39c12 !important;
    font-weight: bold;
    z-index: 100;
}

/* Fading others when a person is selected */
.vis-item.fade-out {
    opacity: 0.2;
}

/* Tooltip Image Styling */
.timeline-portrait {
    max-width: 100px !important;
    max-height: 150px !important;
    width: 100px !important;
    height: auto !important;
    display: block;
    margin-bottom: 5px;
    border-radius: 4px;
}

/* Prevent links from turning purple after being visited */
a,
a:visited {
    color: #3498db;
}

/* Timeline Axis Styling */
.vis-time-axis {
    background-color: rgba(235, 229, 177, 0.5);
}

/* Ensure the library's internal elements are transparent */
.vis-timeline,
.vis-panel {
    background-color: transparent !important;
    border: none !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .app-header {
        padding: 0.5rem;
    }

    .app-header h1 {
        font-size: 1.2rem;
    }

    .app-header p {
        display: none;
    }

    .main-layout {
        margin: 10px auto;
        padding: 0 5px;
    }

    #visualization {
        /* On mobile, let the timeline take up most of the screen height,
           subtracting space for the header and controls hint. */
        height: calc(100vh - 120px);
    }
}