/* Fantasy RPG Theme */
:root {
    --primary-color: #6f42c1;
    --secondary-color: #495057;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --accent-gold: #ffd700;
    --text-light: #e4e4e4;
    --border-color: #3a3a5c;
}

body {
    background: url('/static/backgrounds/dungeon_labyrinth.png') center center / cover no-repeat;
    color: var(--text-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background-attachment: fixed;
}

/* Transparent header */
.transparent-header {
    background: transparent !important;
    border: none !important;
}

/* Logo styling */
.logo-image {
    max-height: 120px;
    height: auto;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* Typography */
.fantasy-title {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Scene main body text styling */
#current-situation {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.8;
    text-align: justify;
    letter-spacing: -0.01em;
}

/* Drop cap effect for first letter */
#current-situation::first-letter {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4em;
    font-weight: 700;
    line-height: 1;
    float: left;
    margin: 0.1em 0.1em 0 0;
    padding: 0.2em 0.3em;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b8860b 100%);
    color: #2c1810;
    border: 2px solid #8b7355;
    border-radius: 3px;
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.4),
        inset 1px 1px 2px rgba(255, 255, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.display-4 {
    background: linear-gradient(45deg, var(--accent-gold), #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cards */
.game-card {
    background: linear-gradient(145deg, rgba(52, 58, 64, 0.9), rgba(33, 37, 41, 0.9));
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(111, 66, 193, 0.2);
}

.game-card .card-header {
    background: linear-gradient(45deg, var(--primary-color), rgba(111, 66, 193, 0.7));
    border-bottom: 1px solid var(--border-color);
    border-radius: 15px 15px 0 0 !important;
    color: white;
}

.game-card .card-body {
    color: var(--text-light);
    font-size: 0.875rem; /* Unified small font size */
}

.game-card .card-body p,
.game-card .card-body div {
    font-size: 0.875rem; /* Ensure consistent small font size */
}

/* Scene text elements styling */
#story-section, #escalation-section {
    font-family: 'Cormorant Garamond', serif !important;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.7;
}

#story-section .fs-5, #escalation-section .fs-5 {
    font-family: 'Cormorant Garamond', serif !important;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Action text in history - make it more visible */
.history-entry p em {
    color: var(--text-light) !important;
    opacity: 0.9;
}

/* Narration text in history - consistent light color */
.history-entry .text-light {
    opacity: 0.85;
}


/* Class Cards */
.class-card {
    background: linear-gradient(145deg, rgba(73, 80, 87, 0.8), rgba(52, 58, 64, 0.8));
    border: 1px solid rgba(111, 66, 193, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.class-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(111, 66, 193, 0.3);
    transform: scale(1.02);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #8b5cf6);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #8b5cf6, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-light);
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* Form Controls */
.form-control, .form-select {
    background-color: rgba(52, 58, 64, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(52, 58, 64, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(111, 66, 193, 0.3);
    color: var(--text-light);
}

.form-control::placeholder {
    color: rgba(228, 228, 228, 0.6);
}

/* Form Labels */
.form-label {
    color: var(--accent-gold);
    font-weight: bold;
    margin-bottom: 8px;
}

/* History Entries */
.history-entry {
    background: rgba(52, 58, 64, 0.6);
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: 'Cormorant Garamond', serif !important;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.history-entry:hover {
    background: rgba(52, 58, 64, 0.8);
    transform: translateX(5px);
}

.history-entry p {
    font-family: 'Cormorant Garamond', serif !important;
    font-weight: 400;
    letter-spacing: -0.005em;
}

/* Badges */
.badge {
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 0.75em;
    font-weight: bold;
}

.bg-secondary {
    background: linear-gradient(45deg, var(--secondary-color), #6c757d) !important;
}

.bg-success {
    background: linear-gradient(45deg, var(--success-color), #34ce57) !important;
}

.bg-danger {
    background: linear-gradient(45deg, var(--danger-color), #e74c3c) !important;
}

.bg-warning {
    background: linear-gradient(45deg, var(--warning-color), #f39c12) !important;
    color: #212529 !important;
}

/* Items Section Styling */
.items-header {
    color: var(--accent-gold) !important;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    font-size: 1rem !important;
    letter-spacing: 1px;
    margin-bottom: 12px !important;
}

.items-container {
    background: rgba(26, 26, 46, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

/* Enhanced item badges */
.item-badge {
    background: linear-gradient(45deg, #f4f1e8, #ede8dc) !important;
    color: #3a2f2a !important;
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 25px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    margin: 4px 6px 4px 0;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
    text-shadow: none;
}

.item-badge:hover {
    background: linear-gradient(45deg, #a0522d, #8b4513) !important;
    color: #f4f1e8 !important;
    border-color: #8b4513;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Item glow animation */
@keyframes itemGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
    }
    50% {
        box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
    }
}

.item-badge:nth-child(even) {
    animation: itemGlow 3s ease-in-out infinite;
    animation-delay: 1s;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Modal */
.modal-content.game-card {
    animation: none;
    transform: none;
}

.modal-content.game-card:hover {
    transform: none;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(52, 58, 64, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .game-card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Column Alignment */
.align-items-end {
    align-items: flex-end !important;
}

/* Utility Classes */
.text-gold {
    color: var(--accent-gold) !important;
}

.border-gold {
    border-color: var(--accent-gold) !important;
}

.bg-dark-transparent {
    background-color: rgba(26, 26, 46, 0.8) !important;
}

/* Icon Animations */
.fas, .far {
    transition: transform 0.3s ease;
}

.btn:hover .fas,
.btn:hover .far {
    transform: scale(1.1);
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.alert-danger {
    background: linear-gradient(45deg, rgba(220, 53, 69, 0.9), rgba(231, 76, 60, 0.9));
    color: white;
}

/* Footer */
footer {
    background: linear-gradient(145deg, rgba(22, 33, 62, 0.9), rgba(26, 26, 46, 0.9));
    border-top: 1px solid var(--border-color);
}

/* Header */
header {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.9), rgba(22, 33, 62, 0.9));
    border-bottom: 1px solid var(--border-color);
}

/* Parchment styling for middle column modules */
.parchment-card {
    background: linear-gradient(45deg, #d4c4a0 0%, #c9b896 25%, #d0c7a6 50%, #c9b896 75%, #d4c4a0 100%);
    border: 2px solid #8b7355;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    border-radius: 8px !important;
}

.parchment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(139, 115, 85, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(139, 115, 85, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(139, 115, 85, 0.05) 2px, transparent 2px);
    background-size: 30px 30px, 40px 40px, 50px 50px;
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}

/* Vignette effect overlay */
.parchment-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 35%,
        rgba(101, 67, 33, 0.08) 65%,
        rgba(75, 60, 38, 0.15) 85%,
        rgba(56, 42, 28, 0.25) 95%,
        rgba(41, 31, 21, 0.5) 100%
    );
    pointer-events: none;
    border-radius: inherit;
    z-index: 2;
}

.parchment-card .card-header {
    background: linear-gradient(135deg, #d4c4a0 0%, #c9b896 100%) !important;
    border-bottom: 2px solid #8b7355 !important;
    color: #4a3c26 !important;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    border-radius: 6px 6px 0 0 !important;
}

.parchment-card .card-body {
    color: #4a3c26 !important;
    background: transparent;
}

.parchment-card .card-body h6 {
    color: #6b4e2a !important;
    font-weight: bold;
}

.parchment-card .card-body .text-primary {
    color: #8b4513 !important;
}

.parchment-card .card-body .text-warning {
    color: #b8860b !important;
}

.parchment-card .card-body .text-danger {
    color: #8b0000 !important;
}

.parchment-card .card-body .text-info {
    color: #556b2f !important;
}

.parchment-card .card-body .text-light {
    color: #5d4e37 !important;
}

.parchment-card .card-body small {
    color: #6b4e2a !important;
}

.parchment-card .card-body p {
    color: #4a3c26 !important;
}

/* Custom column layout with 5% spacing */
.custom-container {
    width: 90%; /* 90% to leave 5% on each side */
    display: flex;
    margin: 0 auto; /* Center the container */
    gap: 5.56%; /* Adjust gap to maintain proportions */
    align-items: flex-start; /* Allow columns to be different heights */
}

/* Position side columns higher independently */
.custom-left-col,
.custom-right-col {
    position: relative;
    top: -8rem; /* Move side columns up by 8rem */
}

/* Make only side columns taller */
.custom-left-col .card,
.custom-right-col .card {
    min-height: 65vh; /* Taller side columns */
}

/* Keep middle column in normal position and natural height */
.custom-middle-col .card {
    min-height: auto; /* Natural height based on content */
    margin-top: 7px; /* Push scene module down slightly */
}

.custom-left-col {
    width: 22.22%; /* 20/90 * 100 to maintain proportions */
}

.custom-middle-col {
    width: 44.44%; /* 40/90 * 100 to maintain proportions */
}

.custom-right-col {
    width: 22.22%; /* 20/90 * 100 to maintain proportions */
}

@media (max-width: 992px) {
    .custom-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .custom-left-col,
    .custom-middle-col,
    .custom-right-col {
        width: 100%;
    }
}

