/* ==========================================
   VIBEFINDER STYLE SHEET - CLEAN VIEWPORT STYLE
   ========================================== */

:root {
    --bg-color: #050508;
    --primary: #f050b5;
    --primary-hover: #ff72cc;
    --primary-glow: rgba(240, 80, 181, 0.25);
    --secondary: #743ad5;
    --success: #00ff88;
    --danger: #ff3366;
    
    --text-main: #fcfcfc;
    --text-muted: #6e707e;
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(240, 80, 181, 0.2);
    
    --header-height: 70px;
    --footer-height: 45px;
    
    --mouse-x: 0.5;
    --mouse-y: 0.5;
}

/* ================= RESET & BAZA ================= */

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

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Całkowite wyłączenie scrollowania całej strony */
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
}

.jetbrains-font {
    font-family: 'JetBrains Mono', monospace !important;
}

/* ================= BACKGROUNDS ================= */

/* Canvas: animowane kulki TYLKO na ekranie logowania */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* Statyczne tło po zalogowaniu — czyste, symetryczne centrum fioletowe */
#dashboard-bg {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 60% at 50% 50%, rgba(100, 40, 200, 0.15) 0%, transparent 70%),
        var(--bg-color);
}

/* Klasa aktywna po zalogowaniu */
body.logged-in #bg-canvas    { display: none; }
body.logged-in #dashboard-bg { display: block; }

/* ================= LAYOUT SCREENS ================= */

/* EKRAN AUTORYZACJI */
.screen-full {
    display: none;
    width: 100%;
    height: 100vh;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(10, 10, 15, 0.4) 0%, rgba(5, 5, 8, 0.75) 100%);
    position: relative;
    z-index: 10;
}

.screen-full.active {
    display: flex;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.6s ease forwards;
}

.login-header-inside {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.logo-img-large {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    margin-bottom: 8px;
}

.logo-name-large {
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.login-title-inside {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
}

.login-subtitle-inside {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 320px;
    margin: 0 auto;
}

.login-form-box {
    background: rgba(10, 10, 15, 0.45);
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    padding: 40px 30px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-form-box:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 35px var(--primary-glow);
}

.input-wrap-clean {
    position: relative;
    margin-bottom: 20px;
}

#license-key-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 10px;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

#license-key-input:focus {
    border-color: var(--primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider:not(:empty)::before {
    margin-right: 15px;
}

.auth-divider:not(:empty)::after {
    margin-left: 15px;
}

.btn-discord {
    width: 100%;
    background: #5865F2;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-discord:hover {
    background: #4752C4;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
}

.btn-discord.loading .btn-text { display: none; }
.btn-discord.loading .btn-loader { display: inline-block; }
.btn-discord.loading .discord-icon { display: none; }

.discord-icon {
    width: 20px;
    height: 20px;
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
}

.btn-clean-primary {
    width: 100%;
    background: var(--text-main);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clean-primary:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-clean-primary.loading .btn-text { display: none; }
.btn-clean-primary.loading .btn-loader { display: inline-block; }
.btn-loader { display: none; }


/* ================= GŁÓWNY PANEL DASHBOARDU ================= */

.screen-full-dashboard {
    display: none;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

.screen-full-dashboard.active {
    display: flex;
}

/* NAGŁÓWEK */
.app-header {
    height: var(--header-height);
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(5, 5, 5, 0.2);
    backdrop-filter: blur(10px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text .main-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.brand-text .sub-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--success);
    display: inline-block;
    vertical-align: middle;
}

.btn-action-logout {
    background: rgba(255, 51, 102, 0.06);
    border: 1px solid rgba(255, 51, 102, 0.2);
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.btn-action-logout:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
    transform: translateY(-1px);
}


/* MAIN CONTENT AREA (Locked to 100vh) */
.app-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: hidden; /* Blokada przewijania w obszarze roboczym */
}

.finder-container {
    width: 100%;
    max-width: 1100px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* WYSZUKIWARKA */
.finder-search-bar-section {
    width: 100%;
}

.finder-search-bar {
    width: 100%;
    height: 64px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 24px;
    transition: border-color 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
}

.finder-search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.search-icon-svg {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-right: 18px;
}

#player-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.15rem;
}

#player-search-input::placeholder {
    color: var(--text-muted);
}

.btn-finder-search {
    height: 48px;
    padding: 0 35px;
    border-radius: 10px;
    border: none;
    background: var(--text-main);
    color: #000;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-finder-search:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* STAN PUSTY (Wyszukiwanie) */
.finder-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.002);
    animation: fadeIn 0.4s ease forwards;
    padding: 40px;
}

.empty-logo-img {
    height: 96px;
    width: auto;
    filter: drop-shadow(0 0 6px var(--primary-glow));
    margin-bottom: 20px;
    animation: logoSpin 10s linear infinite;
}

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

.finder-empty-state h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.finder-empty-state p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 30px;
    max-width: 500px;
}

.clean-suggestions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.suggestion-tag {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    border-color: var(--primary);
    background: rgba(240, 80, 181, 0.08);
    color: var(--primary-hover);
}

body.theme-emerald .suggestion-tag:hover { background: rgba(0, 255, 136, 0.08); border-color: var(--primary); }
body.theme-cyan .suggestion-tag:hover { background: rgba(0, 204, 255, 0.08); border-color: var(--primary); }
body.theme-ruby .suggestion-tag:hover { background: rgba(255, 51, 102, 0.08); border-color: var(--primary); }
body.theme-amber .suggestion-tag:hover { background: rgba(255, 153, 0, 0.08); border-color: var(--primary); }


/* SECTION WYNIKÓW (Wyśrodkowane, bez scrolla w oknie, scroll tylko w tabeli) */
.finder-results-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow: hidden; /* Blokada scrolla dla sekcji wyników */
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Karta Profilu */
.clean-profile-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.avatar-wrap-circle {
    width: 64px;
    height: 64px;
    position: relative;
}

#player-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--border);
    image-rendering: pixelated;
    background: rgba(255, 255, 255, 0.02);
}

.profile-details {
    text-align: left;
}

.profile-details h2 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 4px;
}

.pulse-dot-green {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--success);
}

/* Tabela z przewijaniem wewnątrz */
.clean-table-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.005);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden; /* Ukrywa wystającą tabelę */
    display: flex;
    flex-direction: column;
}

.table-scroll-wrapper {
    flex: 1;
    overflow-y: auto; /* Wewnętrzne przewijanie tylko dla samej tabeli */
    max-height: calc(100vh - 350px); /* Blokada wysokości na podstawie wolnego miejsca w oknie */
}

.clean-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.clean-data-table th {
    position: sticky;
    top: 0;
    background: rgba(20, 20, 26, 0.55); /* Większa przezroczystość */
    backdrop-filter: blur(8px); /* Miękkie rozmycie spodu przy przewijaniu */
    -webkit-backdrop-filter: blur(8px);
    padding: 16px 24px;
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    z-index: 2;
}

.clean-data-table td {
    padding: 16px 24px;
    font-size: 0.98rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.clean-data-table tbody tr {
    transition: background-color 0.2s;
}

.clean-data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.ping-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}


/* ================= FOOTER ================= */

.app-footer {
    height: var(--footer-height);
    width: 100%;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 5, 0.1);
    position: relative;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ================= ANIMACJE ================= */

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

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

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.05); opacity: 0.55; }
    100% { transform: scale(1); opacity: 0.35; }
}

@keyframes pulseStatus {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* Styl suwaka tabeli */
.table-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ================= DODATKOWE STYLE ================= */

@keyframes pulseLogo {
    0% { opacity: 0.85; }
    50% { opacity: 1; }
    100% { opacity: 0.85; }
}

.search-history-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 0 10px;
    animation: fadeIn 0.3s ease;
}

.history-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.history-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    max-height: 60px;
    overflow: hidden;
}

.history-tag {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-tag:hover {
    border-color: var(--primary);
    background: rgba(240, 80, 181, 0.05);
    color: var(--text-main);
}

body.theme-emerald .history-tag:hover { background: rgba(0, 255, 136, 0.05); border-color: var(--primary); }
body.theme-cyan .history-tag:hover { background: rgba(0, 204, 255, 0.05); border-color: var(--primary); }
body.theme-ruby .history-tag:hover { background: rgba(255, 51, 102, 0.05); border-color: var(--primary); }
body.theme-amber .history-tag:hover { background: rgba(255, 153, 0, 0.05); border-color: var(--primary); }

.history-tag-delete {
    font-size: 0.85rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    margin-left: 2px;
}

.history-tag-delete:hover {
    opacity: 1;
    color: var(--danger);
}

.btn-clear-history {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.btn-clear-history:hover {
    color: var(--danger);
}

.discord-pill-name {
    color: #5865F2;
    font-weight: 600;
}

.btn-card-sound {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
    padding: 6px;
    z-index: 12;
}

.btn-card-sound:hover {
    opacity: 0.9;
    transform: scale(1.1);
}

.btn-header-sound {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.btn-header-sound:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-header-sound:active {
    transform: translateY(0);
}
