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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --border-color: rgba(148, 163, 184, 0.1);
    --border-color-hover: rgba(148, 163, 184, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-success: linear-gradient(135deg, #10b981, #34d399);
    --gradient-warning: linear-gradient(135deg, #f59e0b, #fbbf24);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f87171);
    --gradient-card: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Stars Background */
.stars, .stars2, .stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stars {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Ccircle cx='50' cy='50' r='1' fill='rgba(255,255,255,0.3)'/%3E%3Ccircle cx='150' cy='30' r='1.5' fill='rgba(255,255,255,0.4)'/%3E%3Ccircle cx='250' cy='80' r='1' fill='rgba(255,255,255,0.2)'/%3E%3Ccircle cx='30' cy='150' r='1.5' fill='rgba(255,255,255,0.3)'/%3E%3Ccircle cx='200' cy='200' r='1' fill='rgba(255,255,255,0.4)'/%3E%3Ccircle cx='100' cy='250' r='2' fill='rgba(255,255,255,0.3)'/%3E%3Ccircle cx='280' cy='150' r='1' fill='rgba(255,255,255,0.2)'/%3E%3Ccircle cx='70' cy='280' r='1.5' fill='rgba(255,255,255,0.3)'/%3E%3C/svg%3E") repeat;
    animation: starMove 200s linear infinite;
}

.stars2 {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='80' cy='80' r='1' fill='rgba(255,255,255,0.15)'/%3E%3Ccircle cx='200' cy='40' r='1' fill='rgba(255,255,255,0.2)'/%3E%3Ccircle cx='320' cy='100' r='1.5' fill='rgba(255,255,255,0.15)'/%3E%3Ccircle cx='50' cy='200' r='1' fill='rgba(255,255,255,0.2)'/%3E%3Ccircle cx='250' cy='250' r='1' fill='rgba(255,255,255,0.15)'/%3E%3Ccircle cx='150' cy='320' r='2' fill='rgba(255,255,255,0.2)'/%3E%3Ccircle cx='350' cy='200' r='1' fill='rgba(255,255,255,0.15)'/%3E%3C/svg%3E") repeat;
    animation: starMove 300s linear infinite;
    opacity: 0.5;
}

.stars3 {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='500'%3E%3Ccircle cx='120' cy='120' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='300' cy='60' r='1' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='450' cy='150' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='80' cy='300' r='1' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='400' cy='350' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='200' cy='450' r='1' fill='rgba(255,255,255,0.12)'/%3E%3C/svg%3E") repeat;
    animation: starMove 400s linear infinite;
    opacity: 0.3;
}

@keyframes starMove {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

/* Navbar */
.navbar {
    background: rgba(10, 14, 26, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.navbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.navbar .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.05);
}

.navbar .nav-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.navbar .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

.dropdown-menu-dark {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.dropdown-menu-dark .dropdown-item {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.dropdown-menu-dark .dropdown-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-menu-dark .dropdown-divider {
    border-color: var(--border-color);
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    padding-top: 76px;
    min-height: 100vh;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background: var(--gradient-warning);
    color: #1a1a2e;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

/* Forms */
.form-control, .form-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
}

.form-text, .form-control+.form-text {
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.form-check-input {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
}

.form-check-input:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Tables */
.table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

.table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-dark {
    --bs-table-bg: transparent;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

/* Modal */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.modal .btn-close {
    filter: invert(1) brightness(200%);
}

/* Override Bootstrap text colors for dark theme */
.text-secondary, .text-muted {
    color: var(--text-secondary) !important;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) {
    color: var(--accent-primary);
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):hover {
    color: #60a5fa;
}

p, .page-header p, .card-body p, .modal-body p {
    color: var(--text-secondary);
}

small, .small, .form-label, label {
    color: var(--text-secondary);
}

.card-header {
    color: var(--text-primary);
}

/* Pagination */
.page-link {
    color: var(--text-secondary);
    background: var(--bg-card);
    border-color: var(--border-color);
}

.page-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

.page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.page-item.disabled .page-link {
    background: var(--bg-card);
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    background: rgba(10, 14, 26, 0.95);
    position: relative;
    z-index: 1;
}

/* Auth Pages */
.auth-container {
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.auth-card .auth-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
}

.auth-card h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Dashboard Stats */
.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
}

.stat-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Ad Cards */
.ad-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.3s ease;
    height: 100%;
}

.ad-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ad-card .ad-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.ad-card .ad-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-card .ad-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.ad-card .ad-meta span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ad-card .ad-meta .reward {
    color: var(--accent-warning);
    font-weight: 600;
}

/* PTC View Page */
.ptc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.98), rgba(10, 14, 26, 0.98));
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    z-index: 1000;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.timer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.timer-bar-wrapper {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
    min-width: 100px;
}

.timer-bar {
    height: 100%;
    background: var(--gradient-success);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 100px;
}

.timer-text {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-warning);
    min-width: 80px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-visit {
    background: var(--gradient-primary);
    color: white;
    opacity: 0.5;
    pointer-events: none;
}

.btn-visit.active {
    opacity: 1;
    pointer-events: auto;
}

.btn-visit.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.btn-report {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-report:hover {
    background: rgba(239, 68, 68, 0.25);
}

.ptc-info-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ptc-warning-text {
    color: var(--accent-warning);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.iframe-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.focus-warning {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    z-index: 1001;
    display: none;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

/* Captcha */
.captcha-container {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
}

.captcha-container img {
    border-radius: var(--radius-md);
    max-width: 100%;
    height: auto;
}

.captcha-container .captcha-input {
    max-width: 200px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .ptc-header {
        padding: 0.75rem 1rem;
    }
    .timer-text {
        font-size: 1rem;
        min-width: 60px;
    }
    .action-buttons .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    .focus-warning {
        white-space: normal;
        text-align: center;
        max-width: 90%;
        font-size: 0.75rem;
    }
    .auth-card {
        padding: 1.5rem;
    }
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}

/* Utilities */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(26, 35, 50, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

/* Page Header */
.page-header {
    padding: 2rem 0 1.5rem;
}

.page-header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Copy Button */
.copy-btn {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.toast-body {
    color: var(--text-secondary);
}

.toast .btn-close {
    filter: invert(1) brightness(200%);
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-overlay.active {
    display: flex;
}

/* Referral Card */
.referral-link-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    word-break: break-all;
}

.referral-link-box code {
    color: var(--accent-primary);
    font-size: 0.85rem;
}
