/* --- 1. Root Variables (Color System) --- */
:root {
    --primary-color: #4f46e5;       /* Indigo 600 */
    --primary-hover: #4338ca;       /* Indigo 700 */
    --success-color: #10b981;       /* Emerald 500 */
    --bg-color: #f1f5f9;            /* Slate 100 */
    --card-bg: #ffffff;             /* White */
    --text-main: #1e293b;           /* Slate 800 */
    --text-muted: #64748b;          /* Slate 500 */
    --border-color: #e2e8f0;        /* Slate 200 */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* --- 2. Base Body Styles --- */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(at top left, rgba(79, 70, 229, 0.05) 0%, transparent 50%);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Page Visibility Logic */
.page:not(.active) { display: none; }

/* --- 3. Blocker & Overlays (Glass Effect) --- */
.blocker-overlay, .page-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(241, 245, 249, 0.85); /* Semi-transparent background */
    backdrop-filter: blur(8px); /* Modern blur effect */
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}

#telegram-blocker { display: none; }

/* Content Card Design */
.content { 
    max-width: 420px; 
    width: 100%;
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.content i { 
    font-size: 3.5rem; 
    margin-bottom: 1.25rem; 
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.content h1 { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--text-main); 
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.5px;
}

.content p { 
    color: var(--text-muted); 
    font-size: 0.95rem;
    margin: 0;
}

/* Specific Icon Colors */
#telegram-blocker .content i { color: #229ED9; } /* Telegram Blue */
#blocked-overlay .content i { color: #ef4444; }  /* Danger Red */


/* --- 4. Loading Spinners --- */
@keyframes spin { 
    to { transform: rotate(360deg); } 
}

.loading-spinner { 
    width: 48px; 
    height: 48px; 
    border: 5px solid rgba(79, 70, 229, 0.15);
    border-top-color: var(--primary-color);
    border-radius: 50%; 
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
}

/* Button Spinner */
.btn-spinner {
    width: 20px; 
    height: 20px; 
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%; 
    animation: spin 0.8s linear infinite;
    display: none; 
}

/* Button Loading State */
button.is-loading {
    position: relative;
    color: transparent !important; 
    pointer-events: none; 
    opacity: 0.8;
}

button.is-loading .btn-spinner {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
}

button.is-loading > span,
button.is-loading > i {
    visibility: hidden;
}


/* --- 5. Ad Watch Timer Page --- */
#ad-timer-page .content { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
}

.timer-circle {
    width: 100px; 
    height: 100px; 
    border-radius: 50%; 
    background: var(--card-bg);
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 2.5rem; 
    font-weight: 800; 
    color: var(--primary-color); 
    margin-top: 2rem; 
    border: 6px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    position: relative;
}

/* Timer Ring Animation */
.timer-circle::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 6px solid var(--primary-color);
    border-right-color: transparent;
    border-bottom-color: transparent;
    animation: spin 2s linear infinite;
}

#ad-container {
    width: 100%;
    max-width: 340px;
    height: 220px;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #cbd5e1;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-hover);
}


/* --- 6. General UI Elements --- */

/* Claimed Button Style */
.claimed { 
    background: linear-gradient(to right, #10b981, #059669) !important; 
    border: none !important; 
    color: white !important;
    font-weight: 600;
    cursor: not-allowed; 
    opacity: 0.8 !important; 
    box-shadow: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Number Inputs */
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    box-sizing: border-box;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

/* --- 7. Modern Dropdown --- */
.custom-dropdown {
    position: relative;
    width: 100%;
    font-family: inherit;
    margin-bottom: 1.5rem;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.dropdown-selected:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.custom-dropdown.open .dropdown-selected {
    border-color: var(--primary-color);
}

.dropdown-selected img {
    width: 26px;
    height: 26px;
    margin-right: 12px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-selected span {
    flex-grow: 1;
    font-weight: 600;
    color: var(--text-main);
}

.dropdown-selected .arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
    opacity: 0.6;
}

.custom-dropdown.open .dropdown-selected .arrow {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary-color);
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    z-index: 50;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown.open .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.1s;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8fafc;
}

.dropdown-item img {
    width: 32px;
    height: 32px;
    margin-right: 14px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dropdown-item .item-info .name {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    font-size: 0.95rem;
}

.dropdown-item .item-info .min {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}