/* ============================= */
/* 🌐 GENERAL LAYOUT & TYPOGRAPHY */
/* ============================= */
body {
    background-color: #141414;
    color: #e8e6e3;
    font-family: 'Georgia', serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* ============================= */
/* 🧭 HEADINGS */
/* ============================= */
h1,
h2,
h3 {
    font-family: 'Georgia', serif;
    font-weight: bold;
    color: #fefefe;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

/* ============================= */
/* 🔝 TOP NAVIGATION BAR */
/* ============================= */
nav {
    background-color: #951010;
    color: white;
    padding: 1.2rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

nav h1 {
    font-size: 1.8rem;
    font-weight: bold;
    display: inline-block;
    margin: 0;
}

nav a {
    margin-left: 1.5rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* ============================= */
/* 🧱 MAIN CONTENT CONTAINER */
/* ============================= */
main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background-color: #1c1c1c;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

/* ============================= */
/* ✍️ FORMS AND BUTTONS */
/* ============================= */
form {
    margin-bottom: 1.5rem;
}

input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #f87171;
    border-radius: 0.375rem;
    background-color: #111;
    color: white;
}

button {
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, #a51717, #7f1d1d);
    border: 1px solid #911;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #6b0f0f;
    color: #ffffff;
}

/* ============================= */
/* 📊 TABLE STYLES (Overview etc.) */
/* ============================= */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1b1b1b;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-top: 1px solid #374151;
}

th {
    background-color: #2e2e2e;
    color: #ffffff;
}

tr:hover {
    background-color: #262626;
}

/* ============================= */
/* 🔗 LINKS */
/* ============================= */
a {
    color: #fafafa;
    font-weight: bold;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffffff;
}

/* ============================= */
/* 📜 LISTS */
/* ============================= */
ul {
    padding-left: 1rem;
}

li {
    margin-bottom: 0.75rem;
    background-color: #2a2a2a;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ============================= */
/* 🖼️ IMAGES */
/* ============================= */
img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

img:hover {
    transform: scale(1.02);
}

/* ============================= */
/* 🧍 CHARACTER & WEAPON CARDS */
/* ============================= */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.character-card,
.weapon-card {
    background: rgba(32, 32, 32, 0.95);
    border: 1px solid #5a2b2b;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 165, 0, 0.1);
    transition: transform 0.3s ease;
}

.character-card:hover,
.weapon-card:hover {
    transform: translateY(-4px);
}

.character-card h3,
.weapon-card h3 {
    color: #ffffff;
    font-size: 1.3rem;
}

.character-card img,
.weapon-card img {
    border: 2px solid #ffffff;
}

/* ============================= */
/* 📝 DETAIL PAGE LAYOUT */
/* ============================= */
.character-detail {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.profile-image {
    max-width: 300px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.info {
    flex: 1;
    list-style: none;
    padding: 0;
}

/* ============================= */
/* 📂 SIDEBAR NAVIGATION */
/* ============================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(to bottom, #1a1a1a, #000);
    color: #f5f5f5;
    padding: 2rem 1rem;
    box-shadow: 4px 0 20px rgba(255, 215, 0, 0.05);
    overflow-y: auto;
    border-right: 2px solid #333;
}

.sidebar h1 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #ffffff;
    text-align: center;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
}

.sidebar nav li {
    margin: 1rem 0;
}

.sidebar nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    display: block;
}

.sidebar nav a:hover {
    border-left: 3px solid #ffffff;
    background-color: #2a2a2a;
    color: #fefefe;
}

/* ============================= */
/* 🔍 SEARCH FORM */
/* ============================= */
.search-form {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.search-form input {
    padding: 0.5rem;
    border-radius: 0.3rem;
    border: none;
    margin-bottom: 0.5rem;
    background-color: #111;
    color: white;
}

.search-form button {
    padding: 0.5rem;
    background-color: #b91c1c;
    border: none;
    border-radius: 0.3rem;
    color: white;
    cursor: pointer;
}

.search-form button:hover {
    background-color: #991b1b;
}

/* ============================= */
/* 📐 LAYOUT NEXT TO SIDEBAR */
/* ============================= */
.content {
    margin-left: 270px;
    padding: 2rem;
}

/* ============================= */
/* 🎨 ELEMENT THEME COLORS */
/* ============================= */
.theme-fire {
    --primary: #b91c1c;
    --secondary: #c0c0c0;
    --bg: #1f1f1f;
}

.theme-water {
    --primary: #2563eb;
    --secondary: #c0c0c0;
    --bg: #162035;
}

.theme-darkness {
    --primary: #6b21a8;
    --secondary: #77006d;
    --bg: #0c0c0c;
}

.theme-light {
    --primary: #facc15;
    --secondary: #c0c0c0;
    --bg: #868686;
}

body[class^="theme-"] {
    background-color: var(--bg);
    color: var(--secondary);
}

.theme-fire h1,
.theme-fire h2,
.theme-fire h3,
.theme-water h1,
.theme-water h2,
.theme-water h3,
.theme-darkness h1,
.theme-darkness h2,
.theme-darkness h3,
.theme-light h1,
.theme-light h2,
.theme-light h3 {
    color: var(--primary);
}

.character-card,
.weapon-card {
    border-color: var(--primary);
    background-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.08);
}

.character-card img,
.weapon-card img {
    border-color: var(--primary);
}

/* ============================= */
/* 🌪️ ELEMENT SELECT PAGE */
/* ============================= */
.centered-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #ffffff;
}

.element-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem 1rem;
}

.element-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    text-decoration: none;
    border-radius: 1rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

.element-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

.element-card .emoji {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.element-card .label {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.element-card.fire {
    background: linear-gradient(145deg, #8b0000, #d32f2f);
    color: #fff0f0;
    border: 2px solid #c0c0c0;
}

.element-card.water {
    background: linear-gradient(145deg, #1e3a8a, #3b82f6);
    color: #e0f7ff;
    border: 2px solid #c0c0c0;
}

.element-card.darkness {
    background: linear-gradient(145deg, #0f0f0f, #3b0764);
    color: #d1c4e9;
    border: 2px solid #000000;
}

.element-card.light {
    background: linear-gradient(145deg, #fffff0, #fff8dc);
    color: #a16207;
    border: 2px solid #ffd700;
}

/* ============================= */
/* 📋 OVERVIEW TABLE PAGE */
/* ============================= */
.overview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background-color: #1b1b1b;
    color: #f3f3f3;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    font-size: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.overview-table th,
.overview-table td {
    padding: 0.85rem 1.2rem;
    text-align: left;
    border-top: 1px solid #2e2e2e;
}

.overview-table th {
    background-color: #2a2a2a;
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overview-table tr:nth-child(even) {
    background-color: #1f1f1f;
}

.overview-table tr:hover {
    background-color: #2d2d2d;
}

.overview-table a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

.overview-table a:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* ============================= */
/* 🛠️ DETAIL PAGE ACTION BUTTONS */
/* ============================= */
.detail-actions {
    margin-top: 2rem;
}

.detail-actions .button-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(to right, #a51717, #7f1d1d);
    border: 1px solid #911;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.detail-actions .button-link:hover {
    background-color: #6b0f0f;
    color: #ffffff;
}

.detail-actions button[type="submit"] {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(to right, #198754, #157347);
    border: 1px solid #116133;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.detail-actions button[type="submit"]:hover {
    background-color: #0f5132;
}

/* ============================= */
/* 🧾 REGISTER PAGE (register.ejs) */
/* ============================= */
body.page-register {
    background-color: #141414;
    color: #e8e6e3;
    font-family: 'Georgia', serif;
    padding: 2rem;
}

body.page-register h1 {
    text-align: center;
    color: #fefefe;
    font-size: 2rem;
    margin-bottom: 2rem;
}

body.page-register form {
    max-width: 400px;
    margin: 0 auto;
    background-color: #1c1c1c;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.1);
}

body.page-register label,
body.page-register input,
body.page-register button,
body.page-register p,
body.page-register a {
    display: block;
    width: 100%;
}

/* ============================= */
/* 🔐 LOGIN PAGE (login.ejs) */
/* ============================= */
body.page-login {
    background-color: #141414;
    color: #e8e6e3;
    font-family: 'Georgia', serif;
    padding: 2rem;
}

body.page-login h1 {
    text-align: center;
    color: #fefefe;
    font-size: 2rem;
    margin-bottom: 2rem;
}

body.page-login form {
    max-width: 400px;
    margin: 0 auto;
    background-color: #1c1c1c;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.1);
}

body.page-login label,
body.page-login input,
body.page-login button,
body.page-login p,
body.page-login a {
    display: block;
    width: 100%;
}