/* =====================================================
   Wry Discord Checker - Design limpo e profissional
   ===================================================== */

:root {
    --bg-deep:       #0c0e12;
    --bg-card:       #14171e;
    --bg-input:      #1a1e27;
    --bg-hover:      #1e2330;
    --border:        #2a303c;
    --border-focus:  #5865f2;
    --text:          #e8eaed;
    --text-muted:    #8b929e;
    --text-dim:      #5c6370;
    --accent:        #5865f2;
    --accent-hover:  #4752c4;
    --success:       #3ba55d;
    --success-bg:    rgba(59, 165, 93, 0.12);
    --danger:        #ed4245;
    --danger-bg:     rgba(237, 66, 69, 0.12);
    --warning:       #faa61a;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 8px 32px rgba(0,0,0,0.4);
    --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 101, 242, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(88, 101, 242, 0.06), transparent);
}

/* ---------- Layout ---------- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

/* ---------- Header ---------- */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #5865f2, #7289da);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.4rem;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-group label .optional {
    color: var(--text-dim);
    font-weight: 400;
}

.input-wrap {
    position: relative;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.925rem;
    padding: 0.7rem 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    line-height: 1;
}

.toggle-eye:hover {
    color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 550;
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid transparent;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(237, 66, 69, 0.22);
}

.btn-row {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.btn-row .btn {
    flex: 1;
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 0.35rem;
    background: var(--bg-input);
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.4rem;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.15s;
}

.tab.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.tab:hover:not(.active) {
    color: var(--text);
}

/* ---------- User bar ---------- */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865f2, #eb459e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-name {
    font-weight: 550;
    font-size: 0.95rem;
}

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

/* ---------- Status / Alerts ---------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: var(--danger-bg);
    color: #f4878a;
    border: 1px solid rgba(237, 66, 69, 0.25);
}

.alert-success {
    background: var(--success-bg);
    color: #6dd48a;
    border: 1px solid rgba(59, 165, 93, 0.25);
}

.alert-info {
    background: rgba(88, 101, 242, 0.1);
    color: #a0a8f0;
    border: 1px solid rgba(88, 101, 242, 0.2);
}

/* ---------- Progress ---------- */
.progress-section {
    display: none;
    margin-top: 1.5rem;
}

.progress-section.active {
    display: block;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-bar-wrap {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7289da);
    border-radius: 3px;
    width: 0%;
    transition: width 0.25s ease;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.stat-box {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 0.7rem;
    text-align: center;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

.stat-available .stat-value { color: var(--success); }
.stat-taken .stat-value { color: var(--danger); }
.stat-checked .stat-value { color: var(--text); }

/* ---------- Results list ---------- */
.results-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.results-list:empty::after {
    content: 'Nenhum username disponível ainda...';
    display: block;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.88rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.available {
    background: var(--success-bg);
}

.result-name {
    color: var(--success);
    font-weight: 500;
}

.result-copy {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.result-copy:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}

/* ---------- Log (opcional) ---------- */
.log-box {
    max-height: 180px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    color: var(--text-dim);
    line-height: 1.55;
    margin-top: 1rem;
}

.log-line {
    margin-bottom: 0.15rem;
}

.log-available { color: var(--success); }
.log-taken { color: var(--danger); }
.log-error { color: var(--warning); }
.log-info { color: var(--text-muted); }

/* ---------- Grid for generate ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-dim);
    font-size: 0.78rem;
}

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.mt-1 { margin-top: 0.75rem; }
.mb-0 { margin-bottom: 0; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 520px) {
    .container { padding: 1.5rem 1rem; }
    .card { padding: 1.25rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .user-bar { flex-direction: column; gap: 0.8rem; align-items: flex-start; }
}
