/* ============================================
   RUST SKINS PANEL - Industrial Gaming Theme
   ============================================ */

:root {
    --rust-primary: #CD412B;
    --rust-secondary: #8B2500;
    --rust-accent: #FF6B4A;
    --rust-glow: rgba(255, 107, 74, 0.3);
    --bg-dark: #0A0B0D;
    --bg-panel: #12141A;
    --bg-card: #1A1D25;
    --bg-hover: #22262F;
    --bg-input: #0D0E12;
    --text-primary: #E8E9EB;
    --text-secondary: #8B919A;
    --text-muted: #5A6069;
    --success: #4ADE80;
    --warning: #FBBF24;
    --error: #F87171;
    --info: #60A5FA;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(205, 65, 43, 0.4);
    --font-display: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --sidebar-width: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-display); background: var(--bg-dark); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--rust-secondary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--rust-primary); }

/* LOGIN SCREEN */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 20% 80%, rgba(205, 65, 43, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(139, 37, 0, 0.15) 0%, transparent 50%),
                linear-gradient(180deg, var(--bg-dark) 0%, #0D0E12 100%);
    position: relative;
}

.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.01) 2px, rgba(255, 255, 255, 0.01) 4px);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-accent);
    position: relative;
    animation: slideUp 0.6s ease-out;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--rust-secondary), var(--rust-primary), var(--rust-accent));
}

@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.login-header { text-align: center; margin-bottom: 2.5rem; }
.rust-logo { width: 100px; height: 100px; margin: 0 auto 1.5rem; }
.logo-svg { width: 100%; height: 100%; filter: drop-shadow(0 0 20px var(--rust-glow)); animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { filter: drop-shadow(0 0 20px var(--rust-glow)); } 50% { filter: drop-shadow(0 0 30px rgba(255, 107, 74, 0.5)); } }

.login-header h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: 0.3em; text-shadow: 0 0 30px var(--rust-glow); }
.login-header .subtitle { font-family: var(--font-mono); font-size: 0.875rem; color: var(--rust-accent); letter-spacing: 0.2em; }

.login-form { display: flex; flex-direction: column; gap: 1.5rem; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); letter-spacing: 0.15em; }
.input-wrapper { position: relative; }
.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.input-wrapper input:focus { outline: none; border-color: var(--rust-primary); box-shadow: 0 0 0 3px var(--rust-glow); }
.input-wrapper .input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); }

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--rust-primary), var(--rust-secondary));
    border: none;
    color: white;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(205, 65, 43, 0.4); }
.btn-login:hover .btn-arrow { transform: translateX(5px); }
.btn-arrow { transition: transform 0.3s ease; }
.error-message { color: var(--error); font-size: 0.875rem; text-align: center; min-height: 1.5rem; }

.login-footer { margin-top: 2rem; position: relative; height: 20px; overflow: hidden; }
.scan-line { position: absolute; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--rust-accent), transparent); animation: scan 3s linear infinite; }
@keyframes scan { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* MAIN APP */
.app { display: flex; min-height: 100vh; }
.app.hidden { display: none; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
}

.sidebar-header { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--border-subtle); }
.logo-mini svg { width: 40px; height: 40px; }
.logo-text { font-weight: 700; font-size: 1rem; letter-spacing: 0.1em; color: var(--rust-accent); }

.sidebar-nav { flex: 1; padding: 1rem 0; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}
.nav-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rust-primary); transform: scaleY(0); transition: transform 0.2s ease; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--bg-hover); color: var(--rust-accent); }
.nav-item.active::before { transform: scaleY(1); }
.nav-icon { font-size: 1.25rem; }

.sidebar-footer { padding: 1.5rem; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 1rem; }
.server-status { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--text-secondary); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--error); }
.status-dot.online { background: var(--success); box-shadow: 0 0 10px var(--success); }
.btn-logout { padding: 0.75rem 1rem; background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); font-family: var(--font-display); font-size: 0.875rem; cursor: pointer; transition: all 0.2s ease; }
.btn-logout:hover { border-color: var(--error); color: var(--error); }

/* MAIN CONTENT */
.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 2rem; background: var(--bg-dark); }
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.view-header { margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.view-header h2 { font-size: 2rem; font-weight: 700; letter-spacing: 0.05em; }
.view-header p { color: var(--text-secondary); margin-top: 0.25rem; }
.view-actions { display: flex; gap: 1rem; align-items: center; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--rust-primary), transparent); opacity: 0; transition: opacity 0.3s ease; }
.stat-card:hover::before { opacity: 1; }
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-accent); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.stat-icon { font-size: 2.5rem; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; background: var(--bg-hover); border-radius: 8px; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* DASHBOARD */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; }
.panel { background: var(--bg-card); border: 1px solid var(--border-subtle); padding: 1.5rem; }
.panel h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.panel h3::before { content: ''; width: 4px; height: 1em; background: var(--rust-primary); }

.action-buttons { display: flex; flex-direction: column; gap: 0.75rem; }
.btn-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.btn-action:hover { border-color: var(--rust-primary); background: rgba(205, 65, 43, 0.1); }
.action-icon { font-size: 1.5rem; }

.activity-list { display: flex; flex-direction: column; gap: 0.75rem; max-height: 300px; overflow-y: auto; }
.activity-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; background: var(--bg-hover); border-left: 3px solid var(--rust-primary); }
.activity-item.success { border-left-color: var(--success); }
.activity-item.error { border-left-color: var(--error); }
.activity-content { flex: 1; }
.activity-action { font-weight: 500; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

/* SKINS GRID */
.skins-grid, .collections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.skin-card, .collection-card { background: var(--bg-card); border: 1px solid var(--border-subtle); overflow: hidden; transition: all 0.3s ease; }
.skin-card:hover, .collection-card:hover { transform: translateY(-5px); border-color: var(--rust-primary); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4); }
.skin-image, .collection-image { width: 100%; height: 180px; object-fit: cover; background: var(--bg-hover); border-bottom: 1px solid var(--border-subtle); }
.skin-info, .collection-info { padding: 1.25rem; }
.skin-name, .collection-name { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skin-id, .collection-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.skin-actions, .collection-actions { display: flex; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); }

.btn-icon {
    flex: 1;
    padding: 0.625rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-icon:hover { background: var(--rust-primary); border-color: var(--rust-primary); color: white; }
.btn-icon.danger:hover { background: var(--error); border-color: var(--error); }

/* SEARCH */
.search-box { position: relative; }
.search-box input {
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    width: 280px;
    transition: all 0.2s ease;
}
.search-box input:focus { outline: none; border-color: var(--rust-primary); box-shadow: 0 0 0 3px var(--rust-glow); }
.search-box .search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* BUTTONS */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--rust-primary), var(--rust-secondary));
    border: none;
    color: white;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(205, 65, 43, 0.4); }
.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--rust-primary);
    color: var(--rust-accent);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-secondary:hover { background: rgba(205, 65, 43, 0.1); }
.btn-danger { padding: 0.75rem 1.5rem; background: var(--error); border: none; color: white; font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.btn-danger:hover { background: #DC2626; }

/* IMPORT */
.import-container { max-width: 600px; }
.import-tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.tab-btn { flex: 1; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-family: var(--font-display); font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.tab-btn.active { background: var(--rust-primary); border-color: var(--rust-primary); color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.import-form { background: var(--bg-card); border: 1px solid var(--border-subtle); padding: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.form-group input { width: 100%; padding: 1rem; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-primary); font-family: var(--font-display); font-size: 1rem; }
.form-group input:focus { outline: none; border-color: var(--rust-primary); box-shadow: 0 0 0 3px var(--rust-glow); }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.import-preview { margin: 1.5rem 0; padding: 1rem; background: var(--bg-hover); border: 1px solid var(--border-subtle); display: flex; gap: 1rem; align-items: center; }
.import-preview img { width: 120px; height: 120px; object-fit: cover; border: 1px solid var(--border-subtle); }
.preview-info h4 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.preview-info p { font-size: 0.875rem; color: var(--text-secondary); }
.form-actions { display: flex; gap: 1rem; margin-top: 2rem; }

/* HISTORY TABLE */
.history-table-container { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border-subtle); }
.history-table th, .history-table td { padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid var(--border-subtle); }
.history-table th { background: var(--bg-hover); font-weight: 600; font-size: 0.875rem; color: var(--text-secondary); letter-spacing: 0.05em; }
.history-table tr:hover td { background: var(--bg-hover); }
.status-badge { display: inline-block; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.status-badge.success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.status-badge.error { background: rgba(248, 113, 113, 0.15); color: var(--error); }

/* SETTINGS */
.settings-container { max-width: 800px; display: flex; flex-direction: column; gap: 2rem; }
.settings-section { background: var(--bg-card); border: 1px solid var(--border-subtle); padding: 1.5rem; }
.settings-section h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.settings-form { display: flex; flex-direction: column; gap: 1rem; }
.connection-status { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; background: var(--bg-hover); }
.status-indicator { width: 12px; height: 12px; border-radius: 50%; background: var(--error); }
.status-indicator.online { background: var(--success); box-shadow: 0 0 10px var(--success); }
.settings-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.info-item { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; background: var(--bg-hover); }
.info-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.info-value { font-weight: 600; }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(4px); }
.modal-content { position: relative; background: var(--bg-panel); border: 1px solid var(--border-accent); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; animation: modalIn 0.2s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-subtle); }
.modal-header h3 { font-size: 1.25rem; font-weight: 600; }
.modal-close { width: 32px; height: 32px; background: transparent; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: var(--error); }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; padding: 1.25rem 1.5rem; border-top: 1px solid var(--border-subtle); }
.confirm-dialog { max-width: 400px; }

/* TOAST */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.75rem; }
.toast { padding: 1rem 1.5rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-left: 4px solid var(--rust-primary); min-width: 300px; max-width: 450px; animation: toastIn 0.3s ease; display: flex; align-items: center; gap: 1rem; }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 1.25rem; }
.toast-message { flex: 1; font-size: 0.9rem; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; }

.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); font-style: italic; }
.hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .logo-text, .nav-text, .status-text { display: none; }
    .sidebar-header { justify-content: center; }
    .nav-item { justify-content: center; padding: 1rem; }
    .main-content { margin-left: 80px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .skins-grid, .collections-grid { grid-template-columns: 1fr; }
    .view-header { flex-direction: column; }
    .view-actions { width: 100%; flex-wrap: wrap; }
    .search-box input { width: 100%; }
}
@media (max-width: 480px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .login-container { padding: 2rem 1.5rem; margin: 1rem; }
}
