/* Google Fonts - Outfit & Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-base: hsl(224, 30%, 8%);
    --bg-surface: rgba(18, 22, 36, 0.65);
    --bg-surface-opaque: hsl(224, 25%, 12%);
    --primary: hsl(265, 85%, 64%);
    --primary-hover: hsl(265, 85%, 70%);
    --primary-glow: rgba(147, 51, 234, 0.45);
    --accent: hsl(192, 95%, 50%);
    --accent-glow: rgba(6, 182, 212, 0.3);
    --text-main: hsl(210, 20%, 98%);
    --text-muted: hsl(215, 15%, 70%);
    --text-dark: hsl(220, 20%, 15%);
    --success: hsl(142, 70%, 50%);
    --danger: hsl(0, 84%, 60%);
    --warning: hsl(38, 92%, 50%);
    --border-color: rgba(255, 255, 255, 0.08);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 10% 10%, rgba(147, 51, 234, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    padding: 24px;
    transition: var(--transition-smooth);
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(147, 51, 234, 0.1);
}

/* Auth Container */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.5s ease-out;
}
.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}
.auth-logo i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px var(--primary-glow));
}
.auth-logo h2 {
    font-size: 2rem;
    margin-top: 8px;
    letter-spacing: -0.5px;
}

/* Input Styles */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.input-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}
.input-control option {
    background-color: var(--bg-surface-opaque);
    color: var(--text-main);
}
.input-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px var(--primary-glow);
}
.input-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
    gap: 8px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), hsl(265, 80%, 55%));
    color: var(--text-main);
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}
.btn-accent {
    background: linear-gradient(135deg, var(--accent), hsl(192, 90%, 40%));
    color: var(--text-dark);
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    opacity: 0.9;
}
.btn-block {
    width: 100%;
}
.btn:active {
    transform: translateY(0);
}

/* Layout (Sidebar + Main Content) */
.app-container {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 260px;
    background: rgba(14, 18, 30, 0.8);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
}

/* Brand Name in Sidebar */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}
.brand i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}
.brand-title {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Nav Menu */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    gap: 14px;
}
.nav-item i {
    font-size: 1.15rem;
}
.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
    background: linear-gradient(to right, rgba(147, 51, 234, 0.15), rgba(6, 182, 212, 0.03));
    border-left: 3px solid var(--primary);
}

/* User Card in Sidebar Footer */
.user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 20px;
}
.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
.username-label {
    font-weight: 600;
    font-size: 0.95rem;
}
.zcoin-balance {
    font-family: 'Outfit', sans-serif;
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}
.content-title {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

/* Stats Cards Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stat-info h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.stat-info p {
    font-size: 1.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}
.stat-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-icon-box.purple {
    background: rgba(147, 51, 234, 0.15);
    color: var(--primary);
    border: 1px solid rgba(147, 51, 234, 0.25);
}
.stat-icon-box.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.25);
}
.stat-icon-box.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* Main Dashboard Elements Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
@media (min-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Table Design */
.table-container {
    overflow-x: auto;
    width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th {
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    background: var(--bg-surface-opaque);
    z-index: 2;
}
td {
    padding: 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Service Selection Grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.service-card {
    cursor: pointer;
    border: 2px solid transparent;
}
.service-card:hover {
    border-color: rgba(147, 51, 234, 0.3);
}
.service-card.selected {
    border-color: var(--primary);
    background: rgba(147, 51, 234, 0.05);
    box-shadow: 0 0 15px var(--primary-glow);
}
.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.service-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}
.service-badge {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(6, 182, 212, 0.2);
}
.service-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 16px;
    height: 55px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.service-price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}
.price-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.price-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}
.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-completed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-admin {
    background: rgba(147, 51, 234, 0.15);
    color: var(--primary);
    border: 1px solid rgba(147, 51, 234, 0.25);
}

/* Modal UI */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    width: 100%;
    max-width: 500px;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.modal-close {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
}
.modal-close:hover {
    color: var(--text-main);
}

/* Tracker Grid Card List */
.tracker-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.tracker-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tracker-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tracker-keyword {
    font-size: 1.15rem;
    font-weight: 700;
}
.tracker-prod-id {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tracker-ranks {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.tracker-rank-item {
    flex: 1;
    text-align: center;
}
.rank-num-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.rank-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
}
.rank-num.in-rank {
    color: var(--success);
}
.rank-num.out-rank {
    color: var(--text-muted);
}
.chart-container {
    height: 220px;
    width: 100%;
}

/* Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Helper utility styles */
.hidden {
    display: none !important;
}
.text-right {
    text-align: right;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.text-cyan {
    color: var(--accent);
}
.text-purple {
    color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 20px 10px;
    }
    .brand-title, .username-label, .zcoin-balance span, .nav-item span {
        display: none;
    }
    .brand {
        margin-bottom: 20px;
        justify-content: center;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .user-card {
        padding: 8px;
    }
    .user-card button {
        padding: 8px;
        font-size: 0.8rem;
    }
    .main-wrapper {
        margin-left: 70px;
        padding: 20px;
    }
}
