/* ==================== Reset & Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #dc2626;
    --red-glow: #ef4444;
    --dark-bg: #0f0f0f;
    --darker-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
    --header-height: 70px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== Login Page ==================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.login-container {
    position: relative;
    z-index: 10;
}

.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    width: 450px;
    max-width: 90vw;
    border: 1px solid rgba(220, 38, 38, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-red), var(--red-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-content {
    margin: 2rem 0;
}

.login-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.discord-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.discord-login-btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.4);
}

.discord-login-btn svg {
    width: 24px;
    height: 24px;
}

.login-info {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(220, 38, 38, 0.1);
    border-left: 3px solid var(--primary-red);
    border-radius: 5px;
}

.login-info p {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.login-info svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--primary-red);
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.background-animation .circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-red), transparent);
    opacity: 0.1;
    animation: float 20s infinite;
}

.background-animation .circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.background-animation .circle:nth-child(2) {
    width: 400px;
    height: 400px;
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.background-animation .circle:nth-child(3) {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(50px, 50px);
    }
    50% {
        transform: translate(-30px, 80px);
    }
    75% {
        transform: translate(30px, -50px);
    }
}

/* ==================== Sidebar ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid rgba(220, 38, 38, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo {
    max-width: 60px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.3));
}

.sidebar-header h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-red), var(--red-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-red);
    transform: scaleY(0);
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background: rgba(220, 38, 38, 0.1);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.logout-btn:hover {
    background: var(--primary-red);
    color: white;
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* ==================== Main Content ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.top-header {
    height: var(--header-height);
    background: var(--darker-bg);
    border-bottom: 1px solid rgba(220, 38, 38, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle-desktop {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.sidebar-toggle-desktop:hover {
    color: var(--primary-red);
}

.sidebar-toggle-desktop svg {
    width: 24px;
    height: 24px;
}

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

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-red);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-red);
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==================== Content Wrapper ==================== */
.content-wrapper {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
}

/* ==================== Loading Spinner ==================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(220, 38, 38, 0.2);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* ==================== Error Message ==================== */
.error-message {
    padding: 1rem 1.5rem;
    background: rgba(220, 38, 38, 0.1);
    border-left: 4px solid var(--primary-red);
    border-radius: 8px;
    color: var(--red-glow);
    margin-bottom: 1rem;
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.money {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.bank {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.black-money {
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-red);
}

.stat-icon.playtime {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.stat-icon.giveaway {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.stat-icon.discord-invites {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==================== Info Grid ==================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 2rem;
}

.info-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==================== Vehicles Grid ==================== */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.vehicle-card {
    background: var(--card-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
}

.vehicle-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.vehicle-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
}

.vehicle-icon svg {
    width: 28px;
    height: 28px;
}

.vehicle-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.vehicle-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.vehicle-details {
    display: grid;
    gap: 0.5rem;
}

.vehicle-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.vehicle-detail:last-child {
    border-bottom: none;
}

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

.vehicle-value {
    color: var(--text-primary);
    font-weight: 500;
}

.vehicle-stored {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.vehicle-stored.yes {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.vehicle-stored.no {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

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

.inventory-item {
    background: var(--card-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 160px;
}

.inventory-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
}

.item-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    flex-shrink: 0;
}

.item-icon svg {
    width: 32px;
    height: 32px;
}

.item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.3;
    font-size: 0.95rem;
}

.item-count {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(220, 38, 38, 0.2);
    color: var(--primary-red);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: auto;
    flex-shrink: 0;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ==================== Mobile Sidebar Toggle ==================== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--card-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 968px) {
    :root {
        --sidebar-width: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .vehicles-grid {
        grid-template-columns: 1fr;
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .login-card {
        padding: 2rem;
    }

    .user-info {
        display: none;
    }
}

@media (max-width: 640px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
