:root {
    --bg-color: #0d0d0d;
    --text-color: #ccc;
    --header-bg: #1a1a1a;
    --card-bg: #1e1e1e;
    --border-color: #3a3a3a;
    --gold: #ffd700;
    --str-color: #7a0000;
    --agi-color: #004a00;
    --int-color: #003366;
    --link-color: #aaddff;
    --link-hover: #ffffff;
}

@font-face {
    font-family: 'TrajanPro';
    src: local('Trajan Pro'), local('Times New Roman');
}

body {
    background-color: var(--bg-color);
    background-image: url('../img/stone_texture.jpeg');
    background-repeat: repeat;
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'TrajanPro', 'Georgia', serif;
    color: var(--gold);
    text-shadow: 2px 2px 4px #000;
    margin-top: 0;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    min-height: 100vh;
    box-shadow: 0 0 20px #000;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.main-content {
    margin-top: 20px;
}

/* Header & Nav */
header {
    background: var(--header-bg);
    border-bottom: 3px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    height: 70px; /* Fixed height for desktop */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none !important;
}

.logo-area img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 5px rgba(255,215,0,0.5));
}

.logo-area .site-name {
    font-family: 'TrajanPro', serif;
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px #000;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-menu a {
    display: block;
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: bold;
    color: #e0e0e0;
    text-transform: uppercase;
    border-radius: 4px;
    text-decoration: none !important;
}

.nav-menu a:hover, .nav-menu a.active {
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--gold);
    cursor: pointer;
}

/* Mobile Responsive Nav */
@media (max-width: 768px) {
    header {
        height: 60px;
    }

    .logo-area img {
        height: 40px;
    }
    
    .logo-area .site-name {
        font-size: 1.2rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 60px;
        right: 0;
        background: #111;
        width: 250px;
        border-left: 2px solid var(--gold);
        border-bottom: 2px solid var(--gold);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: -5px 5px 15px rgba(0,0,0,0.8);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
    }

    .nav-menu li {
        border-bottom: 1px solid #333;
    }

    .nav-menu a {
        padding: 15px 20px;
        font-size: 1.1rem;
    }
}


/* Hero Section */
.hero-banner {
    width: 100%;
    height: 300px;
    background-image: url('../img/dota_hero_banner.jpeg');
    background-size: cover;
    background-position: center;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.8));
}

.hero-banner h1 {
    font-size: 4rem;
    text-shadow: 0 0 20px #000, 0 0 10px #000;
    letter-spacing: 5px;
    z-index: 1;
}

/* Content Sections */
.section-title {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 2rem;
}

/* Grid Layouts */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border-color: var(--gold);
}

.card img {
    max-width: 100%;
    border: 2px solid #000;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.2rem;
    margin: 5px 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Detail Page */
.detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.detail-left {
    flex: 0 0 280px;
    text-align: center;
}

.detail-right {
    flex: 1;
    min-width: 300px;
}

.detail-portrait {
    width: 100%;
    border: 3px solid var(--gold);
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
}

.stat-box {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.ability-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ability-card {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
}

.ability-icon {
    width: 64px;
    height: 64px;
    border: 2px solid #000;
    object-fit: cover;
}

.ability-info h4 {
    margin-bottom: 5px;
    color: #fff;
}

/* Attributes */
.attr-str { color: #ff9999; }
.attr-agi { color: #99ff99; }
.attr-int { color: #9999ff; }

/* Items */
.item-price {
    color: var(--gold);
    font-weight: bold;
}

.recipe-box {
    margin-top: 20px;
    padding: 15px;
    border: 1px dashed var(--border-color);
}

/* Side Buttons */
#side-buttons {
    position: fixed;
    right: 20px;
    bottom: 50px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.side-btn {
    width: 50px;
    height: 50px;
    background: var(--header-bg);
    border: 2px solid var(--gold);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.side-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--gold);
}

.side-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(100px);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: #666;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
}

@media (max-width: 600px) {
    .detail-container {
        flex-direction: column;
    }
    .detail-left {
        flex: 1;
        width: 100%;
    }
    .hero-banner h1 {
        font-size: 2.5rem;
    }
}
/* Search Box Styles */
.search-container {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.search-form {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--gold);
    border-radius: 30px;
    padding: 5px 20px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.search-form:focus-within {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
    background: rgba(0, 0, 0, 0.9);
}

.search-input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    padding: 10px;
    width: 300px;
    outline: none;
    font-family: 'Segoe UI', sans-serif;
}

.search-input::placeholder {
    color: #888;
}

.search-btn {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s;
}

.search-btn:hover {
    transform: scale(1.2);
    color: #fff;
}

@media (max-width: 600px) {
    .search-input {
        width: 180px;
        font-size: 1rem;
    }
}
body, html {
    overflow-x: hidden;
    width: 100%;
}

.nav-menu {
    /* Ensure it doesn't cause overflow when hidden */
    right: 0;
    max-width: 100vw;
}

/* Fix mobile menu overflow */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed; /* Use fixed to overlay correctly */
        top: 60px;
        right: -250px; /* Hide off-screen */
        width: 250px;
        height: calc(100vh - 60px);
        transform: none; /* Reset transform logic if switching to right positioning */
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
        transform: none;
    }
}
