/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #15151f;
    
    --accent-primary: #00d4ff;
    --accent-secondary: #a855f7;
    --accent-success: #22c55e;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-default: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 212, 255, 0.3);
    
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ===== Background Effects ===== */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* ===== Container ===== */
.container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeInDown 0.6s ease-out;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-text h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 6px;
    text-transform: uppercase;
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===== Input Section ===== */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

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

.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-base);
}

.input-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.input-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.steam-icon {
    width: 32px;
    height: 32px;
    color: var(--text-primary);
}

.input-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.steam-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    transition: var(--transition-base);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.input-glow {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    z-index: -1;
    filter: blur(8px);
    transition: var(--transition-base);
}

.input-wrapper input:focus + .input-glow {
    opacity: 0.3;
}

.submit-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent-primary), #00a8cc);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-base);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-text, .btn-icon {
    position: relative;
    z-index: 1;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    transition: var(--transition-base);
}

.submit-btn:hover:not(:disabled) .btn-icon svg {
    transform: translateX(4px);
}

.btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.input-hint {
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.input-hint code {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--accent-primary);
}

.error-message {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-danger);
    font-size: 0.875rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition-base);
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.demo-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.demo-btn svg {
    width: 16px;
    height: 16px;
}

.demo-btn:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(168, 85, 247, 0.1);
}

/* ===== Loading Section ===== */
.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    text-align: center;
}

.loading-icon {
    margin-bottom: 32px;
}

.crosshair {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    animation: rotate 4s linear infinite;
}

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

.crosshair-line {
    position: absolute;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.crosshair-line:nth-child(1) {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-line:nth-child(2) {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.crosshair-line:nth-child(3) {
    width: 30px;
    height: 2px;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    animation: pulse-line 1s ease-in-out infinite;
}

.crosshair-line:nth-child(4) {
    width: 30px;
    height: 2px;
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    animation: pulse-line 1s ease-in-out infinite 0.5s;
}

@keyframes pulse-line {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Stats Section ===== */
.stats-section {
    animation: fadeInUp 0.5s ease-out;
}

.hidden {
    display: none !important;
}

/* ===== Player Card ===== */
.player-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    animation: slideIn 0.5s ease-out;
}

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

.player-avatar {
    position: relative;
    flex-shrink: 0;
}

.player-avatar img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.avatar-ring {
    position: absolute;
    inset: -4px;
    border: 2px solid var(--accent-primary);
    border-radius: calc(var(--radius-md) + 4px);
    animation: ring-pulse 2s ease-in-out infinite;
}

@keyframes ring-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.05); }
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-steamid {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.player-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.rank-badge {
    font-size: 1.75rem;
    line-height: 1;
}

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

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    position: relative;
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    animation: cardIn 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), 0 8px 30px rgba(0, 212, 255, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 100%;
    height: 100%;
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-detail {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.stat-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-top: auto;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    width: var(--percent);
    transition: width 1s ease-out;
}

.stat-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.stat-indicator.good { background: var(--accent-success); box-shadow: 0 0 10px var(--accent-success); }
.stat-indicator.medium { background: var(--accent-warning); box-shadow: 0 0 10px var(--accent-warning); }
.stat-indicator.bad { background: var(--accent-danger); box-shadow: 0 0 10px var(--accent-danger); }

/* ===== Secondary Stats ===== */
.secondary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.secondary-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    animation: cardIn 0.5s ease-out 0.5s backwards;
}

.secondary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.secondary-header svg {
    width: 24px;
    height: 24px;
    color: var(--accent-secondary);
}

.secondary-header h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ===== List Items ===== */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.list-item-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--accent-primary);
}

.list-item-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.list-item-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* ===== Stats Actions ===== */
.stats-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

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

.action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

.action-btn.secondary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: var(--bg-primary);
}

.action-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
}

/* ===== Footer ===== */
.footer {
    margin-top: auto;
    padding-top: 48px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-disclaimer {
    margin-top: 8px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }
    
    .logo-text h1 {
        font-size: 1.75rem;
    }
    
    .input-card {
        padding: 24px;
    }
    
    .player-card {
        flex-direction: column;
        text-align: center;
    }
    
    .player-info {
        width: 100%;
    }
    
    .player-name {
        text-align: center;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stats-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}
