:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(20, 26, 41, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --primary: #00ff88;
    --primary-hover: #00cc6a;
    --win: #00e676;
    --loss: #ff4757;
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
}

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

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 15% 50%, rgba(0, 255, 136, 0.05), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(0, 150, 255, 0.05), transparent 25%);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    background: rgba(14, 20, 33, 0.95);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.main-content {
    padding: 2rem 3rem;
    overflow-y: auto;
    height: 100vh;
}

header {
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: -webkit-linear-gradient(#fff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.sidebar-header {
    margin-bottom: 1rem;
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: #fff;
    text-transform: uppercase;
}

.logo span {
    color: var(--primary);
}

.login-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: rgba(0, 255, 136, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 600;
}

.steam-login-top {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 700;
}

.steam-login-top:hover {
    transform: translateY(-2px);
    border-color: #66c0f4;
    box-shadow: 0 10px 24px rgba(102, 192, 244, 0.16);
}

.steam-cta-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.steam-cta-button {
    padding: 10px 18px;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);
    color: #fff;
    border: 1px solid rgba(102, 192, 244, 0.5);
    border-radius: 8px;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 12px 30px rgba(27, 40, 56, 0.35);
}

.steam-cta-button:hover {
    transform: translateY(-2px);
    border-color: #66c0f4;
    box-shadow: 0 16px 34px rgba(102, 192, 244, 0.2);
}

.btn-signup {
    background: var(--primary);
    color: #000;
}

.login-btn-small:hover {
    transform: translateY(-2px);
    /* --- SIDEBAR NAV --- */
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tab-btn {
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    transform: translateX(4px);
}

.tab-btn.active {
    background: rgba(0, 255, 136, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    border-radius: 4px 8px 8px 4px;
}

/* --- HISTÓRICO DE BUSCA --- */
.history-section h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Custom Scrollbar for history */
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    transform: translateY(-2px);
}

.history-item img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.history-item .hist-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 255, 136, 0.15);
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.user-badge span {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--primary);
}

.logout-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    background: var(--loss);
    color: #fff;
}

.search-box {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"] {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    margin: 15px 0;
    font-size: 1rem;
}

input {
    width: 400px;
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
    background: rgba(0,0,0,0.6);
}

button {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #000;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

button:disabled {
    background: #555;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.hidden { display: none !important; }

.error {
    color: var(--loss);
    margin-top: 1.5rem;
    font-weight: 600;
}
/* O layout do dashboard agora é controlado 100% pelo Tailwind CSS no próprio index.html */

.stat-group span { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase;}

.result { font-weight: 800; font-size: 1.1rem; padding: 2px 8px; border-radius: 6px; }
.result.win { color: var(--win); background: rgba(0, 230, 118, 0.1); }
.result.loss { color: var(--loss); background: rgba(255, 71, 87, 0.1); }

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

@media (max-width: 768px) {
    .stats-overview { flex-direction: column; width: 100%; }
    .search-box { flex-direction: column; }
    input { width: 100%; }
    .profile-card { flex-direction: column; text-align: center; }
    .match-item { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .match-stats { width: 100%; justify-content: flex-start; gap: 2rem; flex-wrap: wrap;}
}

/* Tabs */
.tabs { display: flex; justify-content: center; gap: 15px; margin-bottom: 2rem; flex-wrap: wrap; }
.tab-btn { padding: 12px 24px; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); color: var(--text-muted); border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.tab-btn.active, .tab-btn:hover { background: rgba(0, 255, 136, 0.15); color: var(--primary); border-color: rgba(0, 255, 136, 0.4); }

/* Views */
.view-section { width: 100%; animation: fadeInUp 0.5s ease; }
.subtitle { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.loading { color: var(--primary); font-weight: 600; text-align: center; margin: 2rem 0; font-size: 1.2rem; }

/* Tables (Meta) */
.table-responsive { width: 100%; overflow-x: auto; background: rgba(0,0,0,0.2); border-radius: 12px; }
.meta-table { width: 100%; border-collapse: collapse; min-width: 600px; text-align: left; }
.meta-table th { padding: 15px 20px; border-bottom: 1px solid var(--glass-border); color: var(--text-muted); text-transform: uppercase; font-size: 0.85rem; }
.meta-table td { padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle;}
.meta-table tr:hover td { background: rgba(0,0,0,0.4); }
.hero-cell { display: flex; align-items: center; gap: 15px; font-weight: 600; font-size: 1.1rem; }
.hero-icon { width: 55px; height: 30px; border-radius: 4px; object-fit: cover; }

/* Pro Grid */
.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.pro-card { background: rgba(0,0,0,0.25); border: 1px solid var(--glass-border); border-radius: 12px; padding: 2rem; display: flex; flex-direction: column; align-items: center; text-align: center; transition: all 0.2s; }
.pro-card:hover { transform: translateY(-5px); background: rgba(0,0,0,0.5); border-color: rgba(0, 255, 136, 0.3); }
.pro-avatar { width: 90px; height: 90px; border-radius: 50%; margin-bottom: 1rem; border: 2px solid var(--primary); box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.pro-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.3rem; }
.pro-team { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.pro-link { background: var(--primary); color: #000; text-decoration: none; padding: 8px 20px; border-radius: 20px; font-size: 0.9rem; font-weight: 800; transition: background 0.2s; cursor: pointer;}
.pro-link:hover { background: var(--primary-hover); transform: scale(1.05); }

/* Select Dropdown */
.rank-select { background: rgba(0,0,0,0.6); color: var(--primary); border: 1px solid rgba(0, 255, 136, 0.4); padding: 10px 20px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; outline: none; font-family: 'Inter', sans-serif; transition: all 0.3s; }
.rank-select:hover, .rank-select:focus { border-color: var(--primary); background: rgba(0, 255, 136, 0.1); }
.rank-select option { background: var(--bg-color); color: #fff; }

/* Guides View */
.build-phase { margin-bottom: 2rem; background: rgba(0,0,0,0.15); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--glass-border); }
.build-phase h3 { border-left: 4px solid var(--primary); padding-left: 10px; margin-bottom: 1.5rem; font-size: 1.3rem; }
.items-row { display: flex; flex-wrap: wrap; gap: 15px; }
.item-card { background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); padding: 15px 10px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; width: 130px; text-align: center; transition: all 0.2s; }
.item-card:hover { transform: scale(1.05); background: rgba(0,0,0,0.6); border-color: var(--primary); }
.item-icon { width: 85px; height: 60px; object-fit: cover; border-radius: 6px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.item-name { font-size: 0.85rem; color: #fff; font-weight: 800; line-height: 1.3; }
.item-count { font-size: 0.75rem; color: var(--primary); margin-top: 8px; font-weight: 600; }

/* Leaderboard */
.rank-number { font-size: 1.2rem; font-weight: 800; color: #ffb800; }
.rank-number.top1 { font-size: 1.8rem; color: #ffd700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.rank-number.top2 { color: #c0c0c0; text-shadow: 0 0 10px rgba(192, 192, 192, 0.5); font-size: 1.6rem; }
.rank-number.top3 { color: #cd7f32; text-shadow: 0 0 10px rgba(205, 127, 50, 0.5); font-size: 1.4rem; }
.lb-name { font-size: 1.1rem; font-weight: 800; color: #fff; }
.lb-sponsor { color: var(--text-muted); font-size: 0.9rem; margin-right: 5px;}

/* Bookmarks */
.bookmarks-container { margin-bottom: 2rem; padding: 1.5rem; border: 1px dashed rgba(255, 255, 255, 0.1); border-radius: 12px; background: rgba(0,0,0,0.2); }
.bookmarks-container h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.bookmarks-list { display: flex; flex-wrap: wrap; gap: 10px; }
.bookmark-tag { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--glass-border); cursor: pointer; transition: all 0.2s; }
.bookmark-tag:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); }
.bookmark-tag img { width: 24px; height: 24px; border-radius: 4px; }
.remove-bookmark { font-size: 0.8rem; color: var(--loss); border: none; background: transparent; padding: 2px; margin-left: 5px; opacity: 0.5; }
.remove-bookmark:hover { opacity: 1; transform: scale(1.2); }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { max-width: 450px; width: 90%; text-align: center; }
.modal-content h2 { margin-bottom: 1rem; color: var(--primary); }
.modal-content p { margin-bottom: 1.5rem; color: var(--text-muted); }
.modal-content input { width: 100%; margin-bottom: 2rem; text-align: center; font-size: 1.2rem; }
.modal-footer { display: flex; gap: 15px; justify-content: center; margin-bottom: 1.5rem; }
.btn-alt { background: rgba(255,255,255,0.1); color: #fff; }
.btn-alt:hover { background: rgba(255,255,255,0.2); }

.modal-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}
.modal-divider span {
    background: #141a29;
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}
.modal-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--glass-border);
}

.steam-auth-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s;
}
.steam-auth-btn:hover { transform: scale(1.05); }
.steam-auth-btn img { display: block; margin: 0 auto; }

/* Save Build Btn */
.save-build-btn { padding: 8px 15px; font-size: 0.8rem; background: rgba(0, 150, 255, 0.2); color: #0096ff; border: 1px solid #0096ff; border-radius: 6px; }
.save-build-btn:hover { background: #0096ff; color: #000; }
.save-build-btn.saved { background: var(--win); color: #000; border-color: var(--win); }
