:root {
    --bg-dark: #0a0a0f;
    --primary: #6d28d9;
    --primary-hover: #7c3aed;
    --accent: #00f2fe;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(20, 20, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --danger: #ef4444;
    --success: #10b981;
    --gold: #fbbf24;
    --silver: #9ca3af;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Basic dark radial background as fallback */
    background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0f 100%);
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* Navbar */
.navbar {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    z-index: 50;
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

body.light-mode {
    --bg-dark: #f0f4f8;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    background: radial-gradient(circle at center, #ffffff 0%, #e2e8f0 100%);
}

body.light-mode .glass-panel {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin: 0 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* Invisible bridge so the hover state isn't lost when moving the mouse down */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 1.5rem;
    background: transparent;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.nav-dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    margin: 0;
    transition: background-color 0.3s;
}

.nav-dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.auth-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hero Section */
.hero-section {
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    position: relative;
    gap: 4rem;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 80%;
    max-width: 1200px;
}

.title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 800;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 500px;
}

/* Glass Panels (Forms) */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease;
}

.glass-panel h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border 0.3s, box-shadow 0.3s;
    appearance: none;
    /* remove default arrow to keep it clean */
}

/* Global Select Option Styling */
select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(109, 40, 217, 0.4);
}

.btn {
    width: 100%;
    padding: 1rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #4c1d95 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(109, 40, 217, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toggle-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.toggle-text span {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
}

.toggle-text span:hover {
    text-decoration: underline;
}

.form-msg {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
}

.msg-error {
    color: var(--danger);
}

.msg-success {
    color: var(--success);
}

.text-gold {
    color: var(--gold);
}

.text-silver {
    color: var(--silver);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shop Layout */
.shop-container {
    padding: 4rem;
    min-height: calc(100vh - 90px);
    position: relative;
    z-index: 10;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.shop-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.item-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 1rem auto;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-icon img {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    /* Keeps Metin2 pixel art sharp when scaled up */
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #ffd700;
    /* Usually metin2 items have gold/yellow text if special */
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 800;
}

.item-price i {
    color: var(--gold);
}

/* Metin2 Style Tooltip */
.tooltip-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.item-tooltip {
    visibility: hidden;
    opacity: 0;
    width: 250px;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    text-align: left;
    border-radius: 6px;
    padding: 1rem;
    position: absolute;
    z-index: 999;
    bottom: 110%;
    /* Place above the item */
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.85rem;
    pointer-events: none;
    /* Ignore mouse over */
}

/* Arrow for the tooltip */
.item-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(10, 10, 15, 0.95) transparent transparent transparent;
}

.tooltip-container:hover .item-tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip-header {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.tooltip-sockets {
    margin-bottom: 0.5rem;
}

.tooltip-socket {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.tooltip-socket img {
    width: 20px;
    height: 20px;
}

.tooltip-attrs {
    color: #6ee7b7;
    /* Bright green for bonus values */
}

/* Custom Checkbox Styling */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.custom-checkbox:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.custom-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(109, 40, 217, 0.4);
}

.custom-checkbox:checked::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    font-size: 0.8rem;
    position: absolute;
}

/* Specific styling for Stash Item checkboxes to make them float nicer */
.item-checkbox-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}