/* ============================================================
   FAUCET WEBSITE — COMPLETE CSS DESIGN SYSTEM
   Light theme · Inter font · Responsive
   ============================================================ */

/* ------ A. CSS Reset & Design Tokens ------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --bg-page: #f5f6fa;
    --bg-white: #ffffff;
    --bg-hover: #f8fafc;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Sidebar */
    --sidebar-width: 260px;

    /* Transitions */
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-page);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
}


/* ------ B. Auth Pages ------ */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-page);
    padding: 20px;
}

.auth-container {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 28px;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.auth-container .form-group {
    margin-bottom: 18px;
}

.auth-container .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-container .form-group input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--bg-white);
}

.auth-container .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.auth-container .btn {
    width: 100%;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.auth-container .btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.auth-container .error {
    background: var(--danger-light);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.auth-container .text-center {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-container .text-center a {
    font-weight: 500;
}


/* ------ C. Dashboard Layout ------ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 20px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px;
    min-width: 0;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-balance {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-name {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Sidebar Toggle (Mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
}


/* ------ D. Cards & Components ------ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
}

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    border-bottom: 3px solid var(--primary-light);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card h3 {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.5px;
}

.stat-card .stat-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}


/* ------ E. Buttons ------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    color: #fff;
}

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

.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #cbd5e1;
    color: var(--text-dark);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* ------ F. Tables ------ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    border-bottom: 2px solid var(--border);
    background: var(--bg-hover);
}

.data-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody td {
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text-dark);
}


/* ------ G. Badges ------ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending {
    background: var(--warning-light);
    color: #92400e;
}

.badge-accepted {
    background: var(--success-light);
    color: #065f46;
}

.badge-denied {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-active {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-paused {
    background: var(--warning-light);
    color: #92400e;
}

.badge-completed {
    background: #e2e8f0;
    color: var(--text-muted);
}


/* ------ H. Forms ------ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group .helper-text {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 5px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}


/* ------ I. Alerts ------ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-error,
.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
}


/* ------ J. Faucet Page ------ */
.faucet-container {
    max-width: 520px;
    margin: 20px auto;
    text-align: center;
    padding: 40px;
}

.faucet-container h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.faucet-container .reward-info {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.cooldown-timer {
    font-size: 2.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-dark);
    margin: 20px 0;
    letter-spacing: 2px;
}

.claim-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    padding: 16px 40px;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.claim-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.claim-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.claim-btn.ready {
    animation: pulse 1.5s ease-in-out infinite;
    background: var(--success);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}


/* ------ K. PTC Page ------ */
.ptc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ptc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.ptc-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.ptc-meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.reward-badge {
    background: var(--success-light);
    color: #065f46;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
}

.duration-badge {
    background: var(--bg-page);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* PTC Countdown Bar */
.countdown-bar-container {
    width: 100%;
    height: 12px;
    background: var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}

.countdown-bar,
#ptcCountdownBar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 6px;
    transition: width 1s linear;
}

.countdown-number,
.countdown-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}


/* ------ L. Modal ------ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    width: 90%;
    max-width: 480px;
    position: relative;
}

.modal-timer {
    margin: 24px 0;
    text-align: center;
}

.modal-ad-area {
    margin: 16px 0;
    min-height: 50px;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color var(--transition);
}

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


/* ------ M. Ad Placements ------ */
.ad-placement {
    text-align: center;
    margin: 12px auto;
    max-width: 100%;
    min-height: 0;
}

.ad-placement:empty {
    display: none;
}


/* ------ N. Toast Notifications ------ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
    max-width: 360px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--primary);
}

.toast.warning {
    background: var(--warning);
    color: var(--text-dark);
}


/* ------ O. Referral ------ */
.input-group {
    display: flex;
    max-width: 600px;
}

.input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--bg-hover);
}

.input-group button {
    padding: 10px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-left: none;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.input-group button:hover {
    background: var(--primary-hover);
}


/* ------ P. Landing Page ------ */
.landing-page header {
    background: var(--bg-white);
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.landing-page .logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.landing-page .hero {
    text-align: center;
    padding: 80px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 50%, #06b6d4 100%);
    color: #fff;
}

.landing-page .hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    line-height: 1.15;
}

.landing-page .hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

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

.landing-page .feature-card {
    background: var(--bg-white);
    padding: 28px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.landing-page .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.landing-page .feature-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}


/* ------ Q. Animations ------ */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes progressBar {
    from { width: 0%; }
    to { width: 100%; }
}

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

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}


/* ------ R. Utility Classes ------ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }


/* ------ T. Rich Text Editor ------ */
.rte-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.rte-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 10px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.rte-btn-group {
    display: flex;
    gap: 2px;
    padding-right: 8px;
    margin-right: 4px;
    border-right: 1px solid var(--border-light);
}

.rte-btn-group:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1;
}

.rte-btn:hover {
    background: var(--border-light);
    color: var(--primary);
}

.rte-btn.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Color picker */
.rte-color-wrapper {
    position: relative;
    display: inline-flex;
}

.rte-color-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Dropdown */
.rte-dropdown-wrapper {
    position: relative;
    display: inline-flex;
}

.rte-dropdown-btn small {
    font-size: 0.65rem;
    margin-left: 2px;
}

.rte-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 20;
    min-width: 120px;
    padding: 4px;
    margin-top: 4px;
}

.rte-dropdown.open {
    display: block;
    animation: fadeIn 0.15s ease;
}

.rte-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
}

.rte-dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Editor Content Area */
.rte-content {
    padding: 20px 24px;
    min-height: 400px;
    outline: none;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-dark);
    overflow-y: auto;
    max-height: 70vh;
}

.rte-content:empty::before {
    content: attr(data-placeholder);
    color: var(--text-light);
    pointer-events: none;
    font-style: italic;
}

.rte-content h1 { font-size: 1.8rem; font-weight: 700; margin: 20px 0 10px; line-height: 1.3; }
.rte-content h2 { font-size: 1.5rem; font-weight: 700; margin: 18px 0 8px; line-height: 1.3; }
.rte-content h3 { font-size: 1.25rem; font-weight: 600; margin: 16px 0 8px; line-height: 1.3; }
.rte-content p { margin: 10px 0; }
.rte-content ul, .rte-content ol { margin: 10px 0; padding-left: 28px; }
.rte-content li { margin: 4px 0; }

.rte-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-dark);
    font-style: italic;
}

.rte-content pre,
.rte-content .rte-code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    overflow-x: auto;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.6;
}

.rte-content a {
    color: var(--primary);
    text-decoration: underline;
}

.rte-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 12px 0;
}

.rte-content .rte-figure {
    margin: 20px 0;
    text-align: center;
}

.rte-content .rte-figure figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

.rte-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 24px 0;
}

/* Status Bar */
.rte-status-bar {
    display: flex;
    justify-content: flex-end;
    padding: 6px 14px;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
}

.rte-word-count {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* Fullscreen */
.rte-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
}

.rte-fullscreen .rte-content {
    flex: 1;
    max-height: none;
}

/* Mobile toolbar */
@media (max-width: 768px) {
    .rte-toolbar {
        padding: 6px;
    }
    .rte-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .rte-content {
        padding: 14px;
        min-height: 280px;
    }
}


/* ------ U. Article Pages ------ */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.article-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-page);
}

.article-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.article-card-body {
    padding: 20px;
}

.article-card-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.article-card-body h3 a {
    color: inherit;
    text-decoration: none;
}

.article-card-body h3 a:hover {
    color: var(--primary);
}

.article-card-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
}

.article-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Single Article View */
.article-content {
    max-width: 780px;
    margin: 0 auto;
}

.article-content .article-header {
    margin-bottom: 32px;
}

.article-content .article-header h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.article-content .article-meta {
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.article-content .article-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #334155;
}

.article-content .article-body h1,
.article-content .article-body h2,
.article-content .article-body h3 {
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.article-content .article-body p {
    margin: 16px 0;
}

.article-content .article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.article-content .article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    margin: 20px 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

.article-content .article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.9rem;
    margin: 20px 0;
}

.article-content .article-body ul,
.article-content .article-body ol {
    padding-left: 28px;
    margin: 14px 0;
}

.article-content .article-body a {
    color: var(--primary);
    text-decoration: underline;
}

.article-content .article-featured-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}


/* ------ S. Responsive ------ */

/* Tablet and below */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 64px;
    }

    .content-with-sidebar {
        flex-direction: column !important;
    }

    .content-with-sidebar .sidebar-column {
        width: 100% !important;
    }

    /* Admin PTC grid fix */
    .content-wrapper > div[style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .user-info {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Admin tables grid */
    .tables-grid {
        grid-template-columns: 1fr !important;
    }

    .landing-page .hero h1 {
        font-size: 2rem;
    }

    .ptc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ptc-item .ptc-item-action {
        align-self: stretch;
    }

    .ptc-item .ptc-item-action .btn {
        width: 100%;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 14px;
        padding-top: 60px;
    }

    .card {
        padding: 18px;
    }

    .faucet-container {
        padding: 24px 18px;
    }

    .countdown-timer {
        font-size: 1.8rem;
    }

    .modal-content {
        padding: 24px 18px;
        width: 95%;
    }

    .landing-page .hero {
        padding: 50px 16px;
    }

    .landing-page .hero h1 {
        font-size: 1.6rem;
    }
}
