:root {
    /* Light Theme Variables */
    --bg-color: #f5f5f5;
    --text-color: #333;
    --section-bg: white;
    --card-bg: #f9f9f9;
    --balance-bg: #e3f2fd;
    --actions-bg: #e8f5e9;
    --withdraw-bg: #fff3e0;
    --admin-bg: #f0f4f8;
    --stats-bg: #eaf2f8;
    --heading-color: #2e86de;
    --btn-color: #2e86de;
    --btn-hover: #1c6dc9;
    --border-color: #e0e0e0;
    --table-row-alt: #f2f7ff;
    --progress-bg: #e0e0e0;
    --active-status: #4CAF50;
    --inactive-status: #F44336;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --danger-color: #e74c3c;
    --danger-hover: #c0392b;
    --note-color: #777;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --section-bg: #1e1e1e;
    --card-bg: #2d2d2d;
    --balance-bg: #1a374d;
    --actions-bg: #1e3a2f;
    --withdraw-bg: #3e2723;
    --admin-bg: #252d3a;
    --stats-bg: #1a2635;
    --heading-color: #64b5f6;
    --btn-color: #3498db;
    --btn-hover: #2471a3;
    --border-color: #424242;
    --table-row-alt: #2c2c2c;
    --progress-bg: #424242;
    --active-status: #388e3c;
    --inactive-status: #c62828;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --danger-color: #e57373;
    --danger-hover: #c62828;
    --note-color: #aaa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.section {
    background-color: var(--section-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px var(--shadow-color);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hidden {
    display: none;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--heading-color);
}

h2 {
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--heading-color);
}

h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--heading-color);
}

p {
    margin-bottom: 20px;
}

.btn {
    background-color: var(--btn-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

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

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

.header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

#logoutBtn, #adminLogoutBtn {
    position: absolute;
    right: 0;
    top: 0;
}

#adminBackBtn {
    position: absolute;
    left: 0;
    top: 0;
}

.balance-card, .actions-card, .withdraw-card, .stats-card {
    width: 100%;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--card-bg);
    box-shadow: 0 1px 3px var(--shadow-color);
}

.balance-card {
    background-color: var(--balance-bg);
}

.actions-card {
    background-color: var(--actions-bg);
}

.auto-surf {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.auto-surf-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#autoSurfStatus {
    font-weight: bold;
    color: var(--heading-color);
}

#autoSurfCount {
    font-size: 1.2em;
}

.withdraw-card {
    background-color: var(--withdraw-bg);
}

.stats-card {
    background-color: var(--stats-bg);
}

#coinBalance, #totalCoins, #totalAdsViewed, #activeUsers {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--heading-color);
}

.timer-container {
    width: 100%;
    margin-bottom: 20px;
}

.progress-bar {
    height: 10px;
    background-color: var(--progress-bg);
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

#progressFill {
    height: 100%;
    width: 0%;
    background-color: var(--btn-color);
    transition: width 1s linear;
}

#autoSurfProgressFill {
    height: 100%;
    width: 0%;
    background-color: var(--btn-color);
    transition: width 1s linear;
}

.timer-paused {
    color: var(--danger-color) !important;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.auto-surf-stats {
    font-weight: bold;
    margin-top: 8px;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

#autoSurfViewDisplay, #autoSurfCoinsEarned, #autoSurfCurrentCount {
    color: var(--heading-color);
    font-size: 1.2em;
}

.ad-container {
    width: 100%;
    height: 500px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

#adFrame {
    width: 100%;
    height: 100%;
}

.interaction-notice {
    margin-top: 20px;
}

.ad-info {
    width: 100%;
    padding: 30px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    text-align: center;
}

.ad-info h3 {
    color: var(--heading-color);
    margin-bottom: 15px;
}

.ad-info p {
    margin-bottom: 10px;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 15px;
}

.theme-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: transform 0.3s, background-color 0.3s;
}

.theme-button:hover {
    transform: scale(1.1);
}

.sun-icon, .moon-icon {
    position: absolute;
    transition: opacity 0.3s, transform 0.5s;
}

/* Light mode (default) */
[data-theme="light"] .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="light"] .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

/* Dark mode */
[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

#themeLabel {
    font-size: 0.9em;
    font-weight: 500;
}

/* Admin Panel Styles */
.users-table-container, .link-stats-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.users-table th, .users-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background-color: var(--heading-color);
    color: white;
    font-weight: 500;
}

.users-table tr:nth-child(even) {
    background-color: var(--table-row-alt);
}

.users-table tr:hover {
    background-color: var(--card-bg);
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 500;
}

.status-active {
    background-color: var(--active-status);
    color: white;
}

.status-inactive {
    background-color: var(--inactive-status);
    color: white;
}

/* Wallet address input styles */
.wallet-input-container {
    display: flex;
    width: 100%;
    margin-bottom: 15px;
}

.wallet-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 0.9em;
    background-color: var(--section-bg);
    color: var(--text-color);
}

.wallet-input-container .btn {
    border-radius: 0 4px 4px 0;
    padding: 10px 15px;
}

.wallet-note {
    font-size: 0.85em;
    color: var(--note-color);
    margin-top: 5px;
}

/* Conversion rate display */
.conversion-rate {
    font-size: 0.9em;
    font-weight: 500;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
}

/* Admin actions */
.admin-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Link URLs in table */
.truncate-url {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Link stats container */
.link-stats-container {
    margin-bottom: 30px;
}

.bannerad {
    width: 728px;
    height: 90px;
    margin: 20px auto;
    border: 1px dashed var(--bg-color);
    background-color:var(--bg-color);
    position: relative;
}
.message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}
.hideeveruthing {
    display: none;
}
.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}
.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}
#ad-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-color);
    font-style: italic;
}
#lockdown-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    padding-top: 20%;
    font-size: 1.5em;
    font-family: sans-serif;
    pointer-events: all;
}
body.locked {
    overflow: hideeveruthing;
}
