/* Buttons */
.btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.google-btn { background-color: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); }
.telegram-btn { background-color: var(--tg-color); color: white; }
.btn img { width: 20px; height: 20px; }

.btn-text { background: none; border: none; color: var(--primary-color); font-weight: 800; cursor: pointer; font-size: 15px; padding: 8px 16px; }

/* Cards */
.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

/* Dropdown Menu */
.header-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 12px;
    transition: var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.header-dropdown-container:hover { background: rgba(0,0,0,0.03); }

.header-dropdown-container::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 12px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 280px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.2s ease-out;
    z-index: 1000; /* Ensure it's above other elements */
    pointer-events: none; /* Block clicks when hidden */
}

/* Specificity boost for visibility */
.header-dropdown-container.active .dropdown-menu {
    display: flex !important;
    pointer-events: auto !important;
}

/* Maintain hover for desktop but don't let it interfere with touch toggle */
@media (hover: hover) {
    .header-dropdown-container:hover .dropdown-menu { 
        display: flex; 
        pointer-events: auto;
    }
}

.dropdown-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-user-info { display: flex; flex-direction: column; text-align: left; }
.dropdown-name { font-weight: 800; font-size: 16px; color: var(--text-main); }
.dropdown-email { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

.dropdown-card-item {
    background: var(--bg-color);
    padding: 14px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-card-item:hover { transform: translateY(-2px); border-color: var(--primary-color); }
.dropdown-card-item img { width: 24px; height: 24px; }
.dropdown-card-item span { font-size: 13px; font-weight: 700; }
.dropdown-card-item.danger { color: var(--danger-color); }
.dropdown-card-item.danger:hover { border-color: var(--danger-color); background: rgba(217, 48, 37, 0.05); }

/* Avatar & Badges */
.profile-img-wrapper { position: relative; display: flex; }
.profile-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-color); }
.header-profile-img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); transition: var(--transition); }
.header-dropdown-container:hover .header-profile-img { border-color: var(--primary-color); }

.provider-badge {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.provider-badge img { width: 12px; height: 12px; }

/* Modal */
#modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: var(--card-bg); padding: 32px; border-radius: 24px; width: 320px; text-align: center; color: var(--text-main); }
.modal-btns { display: flex; gap: 12px; margin-top: 24px; }
.modal-btn { flex: 1; padding: 14px; border-radius: 12px; font-weight: 700; cursor: pointer; border: none; }
.btn-cancel { background: var(--bg-color); color: var(--text-sub); }
.btn-confirm { background: var(--primary-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }

/* Loader */
.loader { border: 3px solid var(--border-color); border-top: 3px solid var(--primary-color); border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; display: inline-block; margin-right: 12px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Theme Selector */
.theme-preview-bar { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }
.theme-dot { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; }
.theme-dot.classic { background-color: #1a73e8; }
.theme-dot.dark { background-color: #202124; }
.theme-dot.midnight { background-color: #bb86fc; }
.theme-dot.forest { background-color: #00897b; }
.theme-dot.stitch { background-color: #0059bf; }
.theme-dot.modern-vibe { background: linear-gradient(135deg, #ff3d71, #00d1ff); }
