/**
 * Narrative Overlay Module Styles
 * Matches Supply Lines dark sci-fi aesthetic
 */

.narrative-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.narrative-overlay.narrative-visible {
    pointer-events: auto;
    opacity: 1;
}

.narrative-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(2px);
}

.narrative-container {
    position: absolute;
    bottom: 0px;
    left: 40px;
    display: flex;
    align-items: flex-end;
    /* gap: 24px; */
}

.narrative-character {
    /* width: 180px;
    height: 280px; */
    transform: translateX(-120%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.narrative-overlay.narrative-visible .narrative-character {
    transform: translateX(0);
}

.narrative-character-exit {
    transform: translateX(-120%) !important;
}

.narrative-character img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 0 20px rgba(34, 211, 238, 0.3));
}

.narrative-character-placeholder {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-panel) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.narrative-character-placeholder::after {
    content: '\f128';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 48px;
    color: var(--text-dim);
}

.narrative-bubble {

    margin-bottom: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px 24px;
    max-height: 350px;
    max-width: 600px;
    min-width: 320px;
    box-shadow:
        0 0 30px rgba(34, 211, 238, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.2s;
}

.narrative-overlay.narrative-visible .narrative-bubble {
    transform: translateY(0);
    opacity: 1;
}

.narrative-text {
    font-size: 2em;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.narrative-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.narrative-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.narrative-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.narrative-page-indicator {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
}

.narrative-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.narrative-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.narrative-btn-action {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    border-color: var(--accent);
    color: var(--accent);
}

.narrative-btn-action:hover {
    background: var(--accent);
    color: var(--bg-deep);
    box-shadow: 0 0 20px var(--accent-glow);
}

.narrative-btn-next {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.narrative-btn-next:hover {
    background: var(--accent);
    color: var(--bg-deep);
}

.narrative-dismiss {
    position: absolute;
    top: -30px;
    right: -30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 66px;
    height: 66px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    transition: all 0.2s ease;
    z-index: 1001;
}

.narrative-dismiss:hover {
    background: var(--red);
    border-color: var(--red);
    color: white;
    box-shadow: 0 0 15px var(--red-glow);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .narrative-container {
        left: 20px;
        right: 20px;
        bottom: 30px;
        flex-direction: column;
        align-items: flex-start;
    }

    .narrative-character {
        /* width: 100px; */
        width: 500px;
    }

    .narrative-bubble {
        max-width: 100%;
        min-width: auto;
        width: calc(100% - 20px);
    }

    .narrative-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .narrative-nav {
        justify-content: flex-end;
        margin-left: 0;
    }
}

/* Animation keyframes for subtle effects */
@keyframes narrativePulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
    }

    50% {
        box-shadow: 0 0 35px rgba(34, 211, 238, 0.25);
    }
}

.narrative-overlay.narrative-visible .narrative-bubble {
    animation: narrativePulse 3s ease-in-out infinite;
}