/* Global Reset & Base */
:root {
    --primary-red: #8a0000;
    --bright-red: #ff0000;
    --primary-gold: #d4af37;
    --bright-gold: #ffd700;
    --dark-bg: #0a0a0a;
    --panel-bg: #111111;
    --text-color: #e0e0e0;
    --border-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: 'Cinzel', 'Trajan Pro', serif; /* Use a fantasy/mmo style font if available */
    line-height: 1.6;
    background: radial-gradient(circle at center, #1a0505 0%, #000000 100%);
    background-size: 200% 200%;
    animation: bgPulse 15s ease infinite;
}

@keyframes bgPulse {
    0% { background-position: 50% 50%; }
    50% { background-position: 52% 52%; } /* Subtle shift */
    100% { background-position: 50% 50%; }
}

a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--bright-red);
    text-shadow: 0 0 5px var(--bright-red);
}

/* Header & Nav */
header {
    background: linear-gradient(to bottom, #220000, #000000);
    border-bottom: 2px solid var(--primary-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Ensure animated theme overlays stay behind content */
header, main, footer { position: relative; z-index: 1; }

/* Removed bgCanvas */

.brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--bright-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav a {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.35rem 0.75rem;
    border: 1px solid transparent;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    line-height: 1;
    border-radius: 8px;
    white-space: nowrap;
}

.nav a:hover, .nav a.active {
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 10px var(--primary-gold);
}

/* Sidebar Nav Reset */
.sidebar-box nav ul {
    display: block;
    list-style: none;
    padding: 0;
}

.sidebar-box nav li {
    margin-bottom: 5px;
}

/* 3D Character Card Flip */
.char-card-container {
    perspective: 1000px;
    width: 240px;
    height: 180px;
    margin-bottom: 20px;
}

.char-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.char-card-container:hover .char-card-inner {
    transform: rotateY(180deg);
}

/* Front and Back styling */
.char-card-front, .char-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    border: 1px solid #333;
}

.char-card-front {
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.char-card-back {
    background: #111;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-color: #f1c40f; /* Highlight the back */
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
    color: #888;
}

.stat-row b { color: #f1c40f; }

/* Main Layout */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    min-height: 80vh;
}

.page {
    text-align: left;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Remove unexpected top gaps on pages by zeroing first-child margins */
main.container > *:first-child { margin-top: 0 !important; }

.hero {
    background: url('/assets/img/banner.jpg') no-repeat center;
    background-size: cover;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--primary-red);
    margin-bottom: 2rem;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* Overlay */
}

.hero h1 {
    font-size: 5em;
    color: white;
    text-shadow: 0 0 20px var(--bright-red);
    letter-spacing: 10px;
    position: relative;
    z-index: 1;
    border: none;
    margin: 0;
}

.news-post {
    background: rgba(26,26,26, 0.9);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 5px solid var(--primary-red);
    border: 1px solid #333;
    border-left-width: 5px;
}

.news-post h2 {
    margin-top: 0;
    color: var(--primary-gold);
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.news-date {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 15px;
    font-style: italic;
}

.sidebar-box {
    background: rgba(26,26,26, 0.9);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--primary-gold);
    margin-bottom: 20px;
}

/* Override h1 globally? No, keep scoped */


/* Forms */
form {
    background: var(--panel-bg);
    padding: 2rem;
    border: 1px solid var(--primary-gold);
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    text-align: left;
}

form::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, var(--primary-gold), var(--primary-red), var(--primary-gold));
    z-index: -1;
    filter: blur(5px);
    opacity: 0.5;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-gold);
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    background: #000;
    border: 1px solid #333;
    color: var(--primary-gold);
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--bright-red);
    box-shadow: 0 0 5px var(--bright-red);
}

button {
    background: linear-gradient(to bottom, #8a0000, #500000);
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

button:hover {
    background: linear-gradient(to bottom, #b30000, #7a0000);
    box-shadow: 0 0 15px var(--primary-red);
    text-shadow: 0 0 5px var(--bright-gold);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid;
    text-align: center;
    font-weight: bold;
}

.alert-success {
    background: rgba(0, 100, 0, 0.3);
    border-color: #0f0;
    color: #0f0;
}

.alert-error {
    background: rgba(100, 0, 0, 0.3);
    border-color: #f00;
    color: #f00;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #333;
    color: #666;
    margin-top: 4rem;
    background: #000;
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Components */
.card {
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(to bottom, #8a0000, #500000);
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #b30000, #7a0000);
    box-shadow: 0 0 10px var(--primary-red);
    color: white;
}

.btn-secondary {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
}

.btn-secondary:hover {
    background: #444;
    color: white;
    border-color: #777;
}

/* Inventory Styles */
.inventory-wrapper {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    gap: 6px;
    background: #111;
    padding: 15px;
    border: 1px solid var(--primary-gold);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    margin-top: 20px;
}

.inventory-section-header {
    grid-column: 1 / -1;
    color: var(--primary-gold);
    font-size: 1.2rem;
    margin-bottom: 10px;
    margin-top: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.item {
    width: 60px;
    height: 60px;
    position: relative;
    border: 1px solid #444;
    background: #000;
    transition: all 0.2s ease;
    cursor: pointer;
}

.item:hover {
    border-color: var(--bright-gold);
    box-shadow: 0 0 5px var(--bright-gold);
    z-index: 10;
}

.icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tooltip {
    display: none;
    position: absolute;
    top: 65px; /* Position below the item */
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--primary-gold);
    padding: 10px;
    font-size: 12px;
    color: white;
    z-index: 999;
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
    pointer-events: none; /* Prevent tooltip from blocking interactions */
    text-align: left;
    white-space: normal;
}

.item:hover .tooltip {
    display: block;
}

.tooltip b {
    color: var(--bright-gold);
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
    border-bottom: 1px solid #333;
    padding-bottom: 3px;
}

.duration {
    color: #ff4444;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.item-opt {
    color: #aaa;
    line-height: 1.4;
}

/* High Upgrade Glow */
.high-upgrade {
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px cyan; border-color: cyan; }
    to { box-shadow: 0 0 15px cyan; border-color: white; }
}

.online { color: lime; font-weight: bold; }
.offline { color: red; font-weight: bold; }

/* Rarity Colors Helper Classes */
.rarity-common { color: #fff; }
.rarity-rare { color: #00ff00; }
.rarity-epic { color: #00bfff; }
.rarity-legendary { color: #ff00ff; }
.rarity-unique { color: #ffa500; }

/* Cabal Client-Style Equipment Layout */
.cabal-equip-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    padding: 20px;
    background: #0a0a0a;
    border: 1px solid var(--primary-gold);
    margin-bottom: 20px;
}

.equip-col-left, .equip-col-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 60px; /* Align with middle of center column visually */
}

.equip-col-center {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.equip-row-center {
    display: flex;
    justify-content: center;
    width: 100%;
}

.equip-row-three {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Equipment Slot Styles */
.equip-slot {
    width: 60px;
    height: 60px;
    border: 1px solid #444;
    background: #000;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.equip-slot:hover {
    border-color: var(--bright-gold);
    box-shadow: 0 0 10px var(--bright-gold);
    z-index: 10;
}

.equip-slot .tooltip {
    display: none;
    position: absolute;
    top: 100%; /* Default: below */
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: rgba(0,0,0,0.95);
    border: 1px solid var(--primary-gold);
    padding: 10px;
    z-index: 1000;
    color: #fff;
    font-size: 12px;
    text-align: left;
    pointer-events: none;
    white-space: normal;
}

/* Tooltip Positioning for Side Columns */
.equip-col-left .equip-slot .tooltip {
    left: 100%;
    top: 0;
    transform: none; /* Reset X translation */
    margin-left: 15px;
}

.equip-col-right .equip-slot .tooltip {
    left: auto;
    right: 100%;
    top: 0;
    transform: none;
    margin-right: 15px;
}

.equip-slot:hover .tooltip {
    display: block;
}

.empty-slot {
    color: #333;
    font-size: 10px;
}

.upgrade-overlay {
    position: absolute;
    bottom: 2px;
    right: 2px;
    color: #0f0;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    z-index: 5;
}
