/* DropForge — Main Stylesheet */
:root {
    --bg-primary:    #0a0e27;
    --bg-secondary:  #0f1535;
    --bg-tertiary:   #161d47;
    --bg-card:       #1a2250;
    --bg-hover:      #222b5e;

    --accent:        #4a6cf7;
    --accent-hover:  #6b8cff;
    --accent-glow:   rgba(74, 108, 247, 0.3);

    --text-primary:  #e8eaf6;
    --text-secondary:#8892b0;
    --text-muted:    #5a6380;

    --success:       #00e676;
    --danger:        #ff5252;
    --warning:       #ffc107;

    --border:        rgba(74, 108, 247, 0.15);

    --r-consumer:     #b0c3d9;
    --r-industrial:   #5e98d9;
    --r-milspec:      #4b69ff;
    --r-restricted:   #8847ff;
    --r-classified:   #d32ce6;
    --r-covert:       #eb4b4b;
    --r-extraordinary:#e4ae39;
    --r-contraband:   #de9b35;
}

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

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

/* ==================== HEADER ==================== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header__logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.header__logo span {
    -webkit-text-fill-color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    letter-spacing: 0;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header__nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all .2s;
}

.header__nav a:hover,
.header__nav a.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.header__user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header__balance {
    background: var(--bg-tertiary);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    color: var(--success);
}

.header__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

/* ==================== MAIN ==================== */
.main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

/* ==================== HERO ==================== */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.hero__title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== CASES GRID ==================== */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent);
    border-radius: 2px;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.case-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all .3s;
    cursor: pointer;
    position: relative;
}

.case-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.case-card__image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    padding: 1rem;
    background: var(--bg-tertiary);
    transition: transform .3s;
}

.case-card:hover .case-card__image {
    transform: scale(1.05);
}

.case-card__body {
    padding: 1rem;
}

.case-card__name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-card__price {
    color: var(--success);
    font-weight: 700;
    font-size: 1.1rem;
}

.case-card__items-count {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.case-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==================== HOW IT WORKS ==================== */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.step-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: all .3s;
}

.step-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.step-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.step-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==================== CASE MODAL ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 20, 0.9);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.modal__close:hover {
    background: var(--danger);
    color: #fff;
}

/* ==================== SPINNER / ROULETTE ==================== */
.roulette-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-tertiary);
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.roulette-container__marker {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: var(--warning);
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.roulette-container__marker::before {
    content: '▼';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--warning);
    font-size: 1.2rem;
}

.roulette-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transition: transform 5s cubic-bezier(0.15, 0.85, 0.25, 1);
}

.roulette-item {
    min-width: 150px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-right: 1px solid var(--border);
    position: relative;
}

.roulette-item__rarity-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.roulette-item__image {
    width: 80px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.roulette-item__name {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.roulette-item__price {
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 600;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent), #6b5ce7);
    color: #fff;
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #8b7cf7);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn--success {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #000;
}

.btn--danger {
    background: linear-gradient(135deg, #d32f2f, #ff5252);
    color: #fff;
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn--outline:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.btn--sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.btn--lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color .2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ==================== TABLES ==================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    font-size: 0.9rem;
}

.table tr:hover td {
    background: var(--bg-hover);
}

/* ==================== RARITY BADGES ==================== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge--consumer       { background: var(--r-consumer); color: #000; }
.badge--industrial      { background: var(--r-industrial); color: #fff; }
.badge--milspec         { background: var(--r-milspec); color: #fff; }
.badge--restricted      { background: var(--r-restricted); color: #fff; }
.badge--classified      { background: var(--r-classified); color: #fff; }
.badge--covert          { background: var(--r-covert); color: #fff; }
.badge--extraordinary   { background: var(--r-extraordinary); color: #000; }
.badge--contraband      { background: var(--r-contraband); color: #000; }

/* ==================== INVENTORY ==================== */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.inv-item {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all .2s;
    cursor: pointer;
    position: relative;
}

.inv-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.inv-item__image {
    width: 100%;
    height: 100px;
    object-fit: contain;
    padding: 0.5rem;
    background: var(--bg-tertiary);
}

.inv-item__info {
    padding: 0.5rem;
}

.inv-item__name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inv-item__price {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

.inv-item__rarity-bar {
    height: 3px;
}

/* ==================== UPGRADE ==================== */
.upgrade-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    flex-wrap: wrap;
}

.upgrade-slot {
    width: 200px;
    min-height: 220px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
}

.upgrade-slot:hover {
    border-color: var(--accent);
}

.upgrade-slot.filled {
    border-style: solid;
}

.upgrade-slot__image {
    width: 100px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.upgrade-slot__name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upgrade-slot__price {
    font-size: 0.8rem;
    color: var(--success);
}

.upgrade-arrow {
    font-size: 2.5rem;
    color: var(--accent);
}

.upgrade-chance {
    text-align: center;
    margin: 1.5rem 0;
}

.upgrade-chance__value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upgrade-chance__label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==================== CONTRACT ==================== */
.contract-container {
    max-width: 800px;
    margin: 0 auto;
}

.contract-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.contract-slot {
    aspect-ratio: 1;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}

.contract-slot.filled {
    border-style: solid;
}

.contract-slot:hover { border-color: var(--accent); }

.contract-slot__image {
    width: 50px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 0.25rem;
}

.contract-slot__name {
    font-size: 0.65rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.contract-target {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}

.contract-target__label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.contract-target__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.contract-target__image {
    width: 80px;
    height: 60px;
    object-fit: contain;
}

.contract-target__name {
    font-size: 1.2rem;
    font-weight: 700;
}

.contract-target__price {
    color: var(--success);
    font-weight: 600;
}

/* ==================== NOTIFICATION ==================== */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    z-index: 300;
    transform: translateX(120%);
    transition: transform .3s ease;
    max-width: 350px;
}

.notification.show { transform: translateX(0); }

.notification--success {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    border-left: 4px solid var(--success);
}

.notification--error {
    background: linear-gradient(135deg, #b71c1c, #c62828);
    color: #fff;
    border-left: 4px solid var(--danger);
}

.notification--info {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    color: #fff;
    border-left: 4px solid var(--accent);
}

/* ==================== ADMIN ==================== */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.admin-sidebar__item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.admin-sidebar__item:hover,
.admin-sidebar__item.active {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-left-color: var(--accent);
}

.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.admin-stat-card__label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.admin-stat-card__value {
    font-size: 1.8rem;
    font-weight: 800;
}

.admin-stat-card__value.success { color: var(--success); }
.admin-stat-card__value.accent   { color: var(--accent); }

/* ==================== DROPDOWN ==================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 180px;
    z-index: 50;
    margin-top: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.dropdown-menu.show { display: block; }

.dropdown-menu__item {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: background .2s;
}

.dropdown-menu__item:hover {
    background: var(--bg-hover);
}

/* ==================== WIN MODAL ==================== */
.win-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 20, 0.95);
    z-index: 250;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.win-overlay.active { display: flex; }

.win-item {
    text-align: center;
    animation: winPop 0.5s ease;
}

.win-item__image {
    width: 250px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 30px var(--accent-glow));
}

.win-item__name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.win-item__price {
    font-size: 1.2rem;
    color: var(--success);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

@keyframes winPop {
    0%   { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shine {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.win-rarity-text {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state__text {
    font-size: 1.1rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header { padding: 0 1rem; }
    .header__nav { gap: 0.5rem; }
    .header__nav a { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
    .main { padding: 1rem; }
    .hero__title { font-size: 2rem; }
    .cases-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .upgrade-container { flex-direction: column; }
    .contract-slots { grid-template-columns: repeat(3, 1fr); }
    .admin-sidebar { display: none; }
    .admin-content { padding: 1rem; }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
