/* --- Base Styles --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc; /* Tailwind slate-50 */
}
.page:not(.active) { display: none; }

/* --- Blocker & Overlays --- */
.blocker-overlay, .page-overlay {
    position: fixed;
    inset: 0;
    background-color: #f8fafc;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}
#telegram-blocker { display: none; }
.content { max-width: 400px; }
.content i { font-size: 4rem; margin-bottom: 1rem; }
.content h1 { font-size: 1.5rem; font-weight: 700; color: #1f2937; margin-bottom: 0.5rem; }
.content p { color: #6b7280; }
#telegram-blocker .content i { color: #0088CC; }
#blocked-overlay .content i { color: #EF4444; }

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

.loading-spinner { 
    width: 40px; 
    height: 40px; 
    border: 4px solid rgba(0, 136, 204, .2);
    border-top-color: #0088CC;
    border-radius: 50%; 
    animation: spin 0.8s linear infinite;
}

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

/* Show spinner and hide text when button has .is-loading class */
button.is-loading {
    position: relative;
    color: transparent !important; /* Hide original button text by making it transparent */
    pointer-events: none; /* Prevent multiple clicks while loading */
}

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

/* Hide original button content (text/icons) when loading */
button.is-loading > span,
button.is-loading > i {
    visibility: hidden;
}


/* --- Ad Watch Timer Page --- */
#ad-timer-page .content { display: flex; flex-direction: column; align-items: center; }
.timer-circle {
    width: 80px; height: 80px; border-radius: 50%; background-color: #e5e7eb;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700; color: #0088CC; margin-top: 1.5rem; border: 4px solid #0088CC;
}

#ad-container {
    width: 300px;
    height: 250px;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #d1d5db;
    text-align: center;
    border-radius: 8px;
}


/* --- General UI --- */
.claimed { 
    background-color: #4CAF50 !important; 
    border-color: #4CAF50 !important; 
    color: white !important;
    cursor: not-allowed; 
    opacity: 0.8 !important; 
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

/* --- Custom Dropdown Styles --- */
.custom-dropdown {
    position: relative;
    width: 100%;
    font-family: inherit;
}
.dropdown-selected {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.dropdown-selected:hover {
    border-color: #d1d5db;
}
.dropdown-selected img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 50%;
}
.dropdown-selected span {
    flex-grow: 1;
    font-weight: 500;
    color: #1f2937;
}
.dropdown-selected .arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}
.custom-dropdown.open .dropdown-selected .arrow {
    transform: rotate(180deg);
}
.dropdown-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.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.2s;
}
.dropdown-item:hover {
    background-color: #f3f4f6;
}
.dropdown-item img {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    border-radius: 50%;
}
.dropdown-item .item-info .name {
    font-weight: 600;
    color: #111827;
}
.dropdown-item .item-info .min {
    font-size: 0.8rem;
    color: #6b7280;
}