/* This Week in History Styles */

/* This Week in History Styles v3 */

.slide[data-slide="history"] {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
}

.slide[data-slide="history"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

/* Tech background (Macintosh) */
.slide[data-slide="history"][data-topic="tech"]::before {
    background-image: url('https://images.unsplash.com/photo-1518770660439-4636190af475?w=1920&h=1080&fit=crop');
}

/* Space background (Concorde) */
.slide[data-slide="history"][data-topic="space"]::before {
    background-image: url('https://images.unsplash.com/photo-1484788984921-03950022c9ef?w=1920&h=1080&fit=crop');
}

/* History background (MLK) */
.slide[data-slide="history"][data-topic="history"]::before {
    background-image: url('https://images.unsplash.com/photo-1461360228754-6e81c478b882?w=1920&h=1080&fit=crop');
}

/* Internet background (Wikipedia) */
.slide[data-slide="history"][data-topic="internet"]::before {
    background-image: url('https://images.unsplash.com/photo-1488590528505-98d2b5aba04b?w=1920&h=1080&fit=crop');
}

/* Music background (Elvis, Beatles) */
.slide[data-slide="history"][data-topic="music"]::before {
    background-image: url('https://images.unsplash.com/photo-1511379938547-c1f69419868d?w=1920&h=1080&fit=crop');
}

/* Toys background (LEGO) */
.slide[data-slide="history"][data-topic="toys"]::before {
    background-image: url('https://images.unsplash.com/photo-1558060370-d644479cb6f7?w=1920&h=1080&fit=crop');
}

.slide[data-slide="history"] .slide-content {
    position: relative;
    z-index: 1;
}

.history-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px 60px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(174, 145, 66, 0.3);
}

.history-title {
    font-size: 3.5rem;
    margin: 0;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow:
        0 0 40px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.9),
        2px 2px 6px rgba(0, 0, 0, 0.8);
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 40px 40px 40px;
}

.history-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border-radius: 25px;
    padding: 40px 50px;
    border: 2px solid rgba(174, 145, 66, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 30px;
    overflow: hidden;
}

.history-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

/* Specific backgrounds based on keywords */
.history-card[data-topic="tech"]::before,
.history-card[data-topic="computer"]::before,
.history-card[data-topic="macintosh"]::before {
    background-image: url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?w=1920&q=80');
}

.history-card[data-topic="space"]::before,
.history-card[data-topic="nasa"]::before,
.history-card[data-topic="concorde"]::before {
    background-image: url('https://images.unsplash.com/photo-1484788984921-03950022c9ef?w=1920&q=80');
}

.history-card[data-topic="history"]::before,
.history-card[data-topic="mlk"]::before,
.history-card[data-topic="civil"]::before {
    background-image: url('https://images.unsplash.com/photo-1461360228754-6e81c478b882?w=1920&q=80');
}

.history-card[data-topic="internet"]::before,
.history-card[data-topic="wikipedia"]::before,
.history-card[data-topic="web"]::before {
    background-image: url('https://images.unsplash.com/photo-1488590528505-98d2b5aba04b?w=1920&q=80');
}

.history-card > * {
    position: relative;
    z-index: 1;
}

.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-color: rgba(212, 175, 55, 0.6);
}

.history-year {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2.5rem;
    font-weight: 800;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow:
        0 0 20px rgba(0, 0, 0, 0.9),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.3);
}

.history-icon {
    font-size: 9rem;
    flex-shrink: 0;
    margin-top: 15px;
}

.history-content-wrapper {
    flex: 1;
    padding-top: 15px;
}

.history-fact-text {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.5);
}

/* Second card: move year and icon to right for visual variety */
.history-content .history-card:nth-child(2) .history-year {
    left: auto;
    right: 20px;
    text-align: right;
}

.history-content .history-card:nth-child(2) {
    flex-direction: row-reverse;
}

.history-content .history-card:nth-child(2) .history-content-wrapper {
    text-align: right;
}
