/* css/style.css */
:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --text-muted: #888888;
    --accent-color: #ffffff;
    --border-color: #333333;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

a:hover {
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header - Mobile First */
header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
}

header nav span {
    text-align: center;
    padding: 0.5rem 0;
}

.logo {
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--text-color);
    text-align: center;
}

/* Forms */
.auth-form {
    max-width: 100%;
    margin: 1.5rem auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #0a0a0a;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: #111;
    border: 1px solid #333;
    color: white;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 16px;
    /* Prevents zoom on iOS */
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #666;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: white;
    color: black;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 0.5rem;
    font-size: 15px;
    text-align: center;
    transition: all 0.2s;
}

.btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.btn-primary {
    background: #4ade80;
    color: #000;
}

.btn-primary:hover {
    background: #3bc970;
}

.btn-outline {
    background: transparent;
    border: 1px solid #444;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 14px;
}

.btn-outline:hover {
    border-color: #666;
    background: #111;
}

.btn-secondary {
    background: transparent;
    border: 1px solid #333;
    color: white;
}

.btn-secondary:hover {
    border-color: #666;
    background: #111;
}

/* Dashboard - Mobile First */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.sidebar {
    order: 1;
}

.main-content {
    order: 2;
}

.sidebar a {
    display: block;
    padding: 0.8rem 0;
    font-size: 1rem;
}

.stat-card {
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 600;
    color: #4ade80;
}

/* Better spacing for mobile */
.stat-card>div[style*="display:flex"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: stretch !important;
}

.stat-card button {
    width: 100% !important;
    margin: 0 !important;
}

/* Code blocks */
code {
    display: block;
    padding: 0.5rem;
    background: #111;
    border-radius: 4px;
    font-size: 0.75rem;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Earning Page */
.earn-container {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

.timer-circle {
    width: 100px;
    height: 100px;
    border: 4px solid #333;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}

.timer-active {
    border-color: #4ade80;
    color: #4ade80;
}

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem 2rem;
    }

    header nav {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        width: auto;
    }

    header nav span {
        text-align: left;
        padding: 0;
    }

    .logo {
        text-align: left;
    }

    .auth-form {
        max-width: 420px;
        margin: 3rem auto;
        padding: 2rem;
    }

    .dashboard-grid {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 2rem;
    }

    .sidebar {
        order: 0;
        border-right: 1px solid var(--border-color);
        padding-right: 2rem;
    }

    .main-content {
        order: 0;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-card>div[style*="display:flex"] {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .stat-card button {
        width: auto !important;
    }

    .earn-container {
        margin-top: 4rem;
    }

    .timer-circle {
        width: 140px;
        height: 140px;
        font-size: 2.5rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    header {
        padding: 1.5rem 4rem;
    }

    .dashboard-grid {
        grid-template-columns: 300px 1fr;
    }

    .container {
        padding: 2.5rem;
    }
}

/* Extra refinements for very small screens */
@media (max-width: 375px) {
    .container {
        padding: 0.75rem;
    }

    header {
        padding: 0.75rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 14px;
    }
}

/* Admin Panel Pagination & Search */
.admin-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-controls input[type="search"] {
    width: 100%;
    padding: 0.7rem;
    background: #111;
    border: 1px solid #333;
    color: white;
    border-radius: 6px;
    font-size: 14px;
}

.section-controls select {
    width: 100%;
    padding: 0.7rem;
    background: #111;
    border: 1px solid #333;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #333;
    border-radius: 6px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.btn-pag {
    padding: 0.5rem 0.8rem;
    background: #111;
    border: 1px solid #333;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    min-width: 36px;
    transition: all 0.2s;
}

.btn-pag:hover:not(:disabled) {
    background: #222;
    border-color: #666;
}

.btn-pag.active {
    background: #4ade80;
    color: #000;
    border-color: #4ade80;
}

.btn-pag:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 13px;
    color: #888;
    margin-left: 1rem;
}

.btn-small {
    padding: 0.4rem 0.7rem;
    background: #4ade80;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 0.25rem;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #3bc970;
}

.btn-small.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #b91c1c;
}

.btn-small.btn-success {
    background: #16a34a;
    color: white;
}

.btn-small.btn-success:hover {
    background: #15803d;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.badge-green {
    background: #14532d;
    color: #86efac;
}

.badge-red {
    background: #7f1d1d;
    color: #fca5a5;
}

/* Tablet and up */
@media (min-width: 768px) {
    .section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .section-controls {
        flex-direction: row;
        width: auto;
    }
    
    .section-controls input[type="search"] {
        width: 250px;
    }
    
    .section-controls select {
        width: auto;
    }
    
    .pagination {
        justify-content: flex-start;
    }
}
