/* KikFinds - Global Stylesheet */

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

:root {
    --brand: #FF5C5C;
    --brand-dark: #cc3c3c;
    --dark: #1a1a2e;
    --mid: #2d2d44;
    --card-bg: #232336;
    --text: #f0f0f5;
    --text-muted: #a0a0b8;
    --border: rgba(255,255,255,0.08);
    --gold: #FFD700;
    --green: #4ADE80;
}

body {
    background: var(--dark);
    color: var(--text);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Navigation ─── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(26,26,46,0.95);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--brand);
    text-decoration: none;
}

.nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.nav-links a:hover { color: var(--text); }

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

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
}

/* ─── Buttons ─── */
.btn-primary {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--brand-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.btn-secondary:hover { border-color: rgba(255,255,255,0.3); }

.btn-nav {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.btn-nav:hover { background: var(--brand-dark); }

.btn-logout {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s;
}

.btn-logout:hover { border-color: rgba(255,255,255,0.3); }

.btn-save {
    background: var(--brand);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background 0.2s;
}

.btn-save:hover { background: var(--brand-dark); }

.btn-premium {
    background: var(--gold);
    color: var(--dark);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
    transition: opacity 0.2s;
}

.btn-premium:hover { opacity: 0.9; }

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

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
}

/* ─── Alerts ─── */
.error {
    background: rgba(255,92,92,0.15);
    color: #ff9999;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.success, .message {
    background: rgba(74,222,128,0.15);
    color: #86efac;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ─── Cards ─── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

/* ─── Auth pages (login / register) ─── */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: var(--dark);
}

.auth-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-box h1 { font-size: 1.8rem; margin-bottom: 0.5rem; font-weight: 700; }
.auth-box p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

.btn-auth {
    width: 100%;
    padding: 0.85rem;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-auth:hover { background: var(--brand-dark); }

.auth-footer-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer-link a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

/* ─── Browse page ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { margin-bottom: 0.5rem; }

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.filters select {
    padding: 0.75rem;
    width: auto;
}

.filters button {
    padding: 0.75rem 1.5rem;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.profile-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.profile-card.premium {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(255,215,0,0.1), transparent);
}

.profile-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,92,92,0.4);
}

.premium-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gold);
    color: var(--dark);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.kik-username {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand);
    margin: 1rem 0;
    word-break: break-all;
}

.profile-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.copy-btn {
    background: var(--brand);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.copy-btn:hover { background: var(--brand-dark); }

.bump-count {
    display: inline-block;
    background: rgba(255,92,92,0.2);
    color: var(--brand);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.time { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

.premium-badge { color: var(--gold); font-weight: 600; }
.bump-badge { color: var(--brand); font-weight: 600; }

/* ─── Profile page ─── */
.profile-container { max-width: 600px; margin: 2rem auto; padding: 2rem; }

.profile-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.profile-box h2 { margin-bottom: 1.5rem; }

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.premium-value { color: var(--gold); }
.bump-value { color: var(--brand); }

.user-info {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.user-info p { margin: 0.5rem 0; font-size: 0.9rem; }

.divider { border-top: 1px solid var(--border); margin: 2rem 0; }

/* ─── Index / Landing page ─── */
.index-body {
    background: linear-gradient(135deg, var(--dark) 0%, var(--mid) 100%);
}

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content { flex: 1; max-width: 550px; }
.hero-content h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.hero-content h2 { font-size: 1.8rem; color: var(--brand); margin-bottom: 1rem; }
.hero-content p { font-size: 1rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 2rem; }
.hero-cta { display: flex; gap: 1rem; }

.features {
    padding: 4rem 2rem;
    background: rgba(0,0,0,0.2);
}

.features-container { max-width: 1200px; margin: 0 auto; }

.features-title { text-align: center; margin-bottom: 3rem; }
.features-title h2 { font-size: 2rem; margin-bottom: 0.5rem; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255,92,92,0.4);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.3rem; margin-bottom: 0.75rem; }
.feature-card p { color: var(--text-muted); line-height: 1.6; }

footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* ─── Admin page ─── */
.admin-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h1 { font-size: 1.8rem; }

.admin-badge {
    background: var(--brand);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.75rem;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-bar input {
    flex: 1;
    max-width: 400px;
}

.users-table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.users-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.users-table tr:last-child td { border-bottom: none; }

.users-table tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-premium { background: rgba(255,215,0,0.2); color: var(--gold); }
.badge-free { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.badge-active { background: rgba(74,222,128,0.15); color: #86efac; }
.badge-inactive { background: rgba(255,92,92,0.15); color: #ff9999; }
.badge-vpn { background: rgba(255,92,92,0.15); color: #ff9999; }

.btn-edit {
    background: var(--brand);
    color: white;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-edit:hover { background: var(--brand-dark); }

.btn-delete {
    background: transparent;
    color: #ff9999;
    border: 1px solid rgba(255,92,92,0.3);
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-delete:hover { background: rgba(255,92,92,0.15); }

/* Edit modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-grid .full-width { grid-column: 1 / -1; }

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .btn-save { width: auto; flex: 1; }

.btn-cancel {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-cancel:hover { border-color: rgba(255,255,255,0.3); }

.stat-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.summary-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--brand); }
.summary-card .stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero { flex-direction: column; text-align: center; }
    .hero-content h1 { font-size: 2rem; }
    .hero-cta { justify-content: center; flex-direction: column; }
    .modal-grid { grid-template-columns: 1fr; }
    .admin-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    nav { padding: 1rem; }
    .container, .admin-container { padding: 1rem; }
    .users-table-wrap { overflow-x: auto; }
}
