/* ============================================
   STYLE.CSS - My Profile Page
   (Header & mobile nav come from shared components)
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
    color: #333333;
    min-height: 100vh;
    line-height: 1.6;
}

@media (max-width: 899px) {
    body { padding-bottom: 84px; }
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #888888;
    --navy: #13152B;
    --navy-light: #18192D;
    --purple: #4B3B60;
    --purple-light: #493B5E;
    --lime: #A2D819;
    --lime-dark: #8CB815;
    --green: #1E8535;
    --green-dark: #166A29;
    --violet: #6C2BD9;
    --violet-light: #7C3AED;
    --gold: #f5b342;
    --gold-dark: #d4942e;
    --grey: #888888;
    --grey-light: #e8e8e8;
    --border: #e0e0e0;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 24px rgba(0, 0, 0, 0.10);
}

/* ---------- PROFILE SECTION ---------- */
.profile-section {
    padding: 40px 0 60px;
    min-height: calc(100vh - 70px - 300px);
}

.profile-container {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-header {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
}

.profile-info { flex: 1; }

.profile-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 4px;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 133, 53, 0.1);
    color: var(--green);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-badge i { font-size: 0.7rem; }

.profile-actions { flex-shrink: 0; }

.btn-profile-action {
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-edit {
    background: var(--violet);
    color: #ffffff;
}

.btn-edit:hover {
    background: var(--violet-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(108, 43, 217, 0.3);
}

.profile-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow);
}

.profile-card { margin-bottom: 0; }

.profile-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-card h3 i { color: var(--violet); }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 14px 18px;
}

.info-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

/* ---------- MODAL ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 90%;
    padding: 32px;
    animation: modalSlideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i { color: var(--violet); }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-form .form-group { margin-bottom: 16px; }

.modal-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-form .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: #fafafa;
    color: var(--text-primary);
}

.modal-form .form-group input:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(108, 43, 217, 0.1);
    background: #ffffff;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel {
    background: #f5f5f5;
    color: var(--text-secondary);
}
.btn-cancel:hover { background: var(--border); }

.btn-save {
    background: var(--violet);
    color: #ffffff;
}
.btn-save:hover {
    background: var(--violet-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(108, 43, 217, 0.3);
}

/* ---------- SUCCESS MODAL ---------- */
.success-modal-content {
    max-width: 450px;
    text-align: center;
    padding: 40px 32px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-icon i {
    font-size: 2.8rem;
    color: #ffffff;
}

.success-modal-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.success-modal-content > p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.success-details {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    text-align: left;
}

.success-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e8edf2;
}

.success-detail-item:last-child { border-bottom: none; }

.success-detail-item .detail-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-detail-item .detail-label i {
    color: var(--violet);
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.success-detail-item .detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
}

.success-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.success-modal-buttons .btn-primary {
    padding: 14px 48px;
    background: linear-gradient(135deg, var(--violet), var(--purple));
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.success-modal-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(108, 43, 217, 0.3);
    background: linear-gradient(135deg, var(--violet-light), var(--violet));
}

/* ---------- COUNTRY SELECTOR ---------- */
.country-select-wrapper { position: relative; width: 100%; }

.country-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.country-input-wrapper input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: #fafafa;
    color: var(--text-primary);
    width: 100%;
    cursor: pointer;
}

.country-input-wrapper input:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(108, 43, 217, 0.1);
    background: #ffffff;
}

.country-input-wrapper input:read-only { cursor: pointer; }

.country-input-wrapper .country-arrow {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
    transition: var(--transition);
}

.country-input-wrapper.open .country-arrow { transform: rotate(180deg); }

.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.country-dropdown.open { max-height: 280px; opacity: 1; }

.country-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.country-search i { color: var(--text-muted); font-size: 0.85rem; }

.country-search input {
    border: none;
    background: none;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    width: 100%;
    outline: none;
}

.country-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.country-list::-webkit-scrollbar { width: 4px; }
.country-list::-webkit-scrollbar-track { background: #f5f5f5; }
.country-list::-webkit-scrollbar-thumb { background: var(--violet); border-radius: 4px; }

.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.country-option:hover { background: rgba(108, 43, 217, 0.06); }
.country-option.selected { background: rgba(108, 43, 217, 0.1); color: var(--violet); }

.country-option .flag { font-size: 1.2rem; width: 28px; text-align: center; }
.country-option .country-name { flex: 1; }
.country-option .country-code { color: var(--text-muted); font-size: 0.75rem; }
.country-option .check-icon { color: var(--violet); font-size: 0.8rem; }

/* ---------- COUNTRY BOTTOM SHEET ---------- */
.sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.sheet-overlay.open { opacity: 1; visibility: visible; }

.bottom-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
}
.bottom-sheet.open { transform: translateY(0); }

.country-sheet { max-height: 70vh; height: 70vh; }

.country-sheet .sheet-container {
    padding: 0 20px 20px;
    max-height: 70vh;
    height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.sheet-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

.sheet-header h3 i { margin-right: 8px; }

.sheet-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-close:hover { background: var(--bg-primary); color: var(--text-primary); }

.sheet-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f5f5f5;
    border-radius: var(--radius);
    margin: 8px 0 12px;
    flex-shrink: 0;
}

.sheet-search i { color: var(--text-muted); font-size: 0.9rem; }

.sheet-search input {
    border: none;
    background: none;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    width: 100%;
    outline: none;
}

.country-sheet .sheet-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.country-sheet-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.country-sheet-option:hover { background: rgba(108, 43, 217, 0.06); }
.country-sheet-option.selected { background: rgba(108, 43, 217, 0.1); color: var(--violet); }

.country-sheet-option .flag { font-size: 1.3rem; width: 32px; text-align: center; }
.country-sheet-option .country-name { flex: 1; }
.country-sheet-option .country-code { color: var(--text-muted); font-size: 0.8rem; }
.country-sheet-option .check-icon { color: var(--violet); font-size: 0.9rem; }

/* ---------- FOOTER ---------- */
.footer {
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-brand .logo-highlight { font-size: 1.4rem; font-weight: 900; color: var(--violet); }

.footer-brand p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 8px;
    max-width: 300px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.footer-column h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    padding: 4px 0;
    transition: var(--transition);
}

.footer-column a:hover { color: var(--lime); }

.footer-column .telegram-link { color: rgba(38, 165, 228, 0.7) !important; }
.footer-column .telegram-link:hover { color: #26a5e4 !important; }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

/* ---------- TOAST ---------- */
#customToast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 99999;
    display: none;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    font-family: 'Inter', sans-serif;
    max-width: 90%;
    text-align: center;
}

#customToast.success { background: var(--green); }
#customToast.error   { background: #dc3545; }
#customToast.info    { background: var(--violet); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .footer-content { grid-template-columns: 1fr; gap: 30px; }
    .footer-links { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    .profile-info { text-align: center; }
    .info-grid { grid-template-columns: 1fr; }
    .footer-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .profile-header { padding: 20px; }
    .profile-avatar { width: 80px; height: 80px; font-size: 1.8rem; }
    .profile-info h1 { font-size: 1.3rem; }
    .profile-content { padding: 16px; }
    .info-item { padding: 12px 14px; }
    .modal-content { padding: 20px; width: 95%; }
    .success-modal-content { padding: 32px 20px; max-width: 95%; }
    .success-icon { width: 64px; height: 64px; }
    .success-icon i { font-size: 2.2rem; }
    .success-modal-content h3 { font-size: 1.2rem; }
    .success-details { padding: 12px 16px; }
    .success-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 6px 0;
    }
    .success-detail-item .detail-label { font-size: 0.75rem; }
    .success-detail-item .detail-value { font-size: 0.85rem; }
    .success-modal-buttons .btn-primary { padding: 12px 32px; font-size: 0.9rem; }
    .country-sheet { max-height: 75vh; height: 75vh; }
    .country-sheet .sheet-container { max-height: 75vh; height: 75vh; padding: 0 16px 16px; }
    .country-sheet-option { padding: 10px 14px; font-size: 0.85rem; }
    .country-sheet-option .flag { font-size: 1.1rem; width: 28px; }
    .sheet-search { padding: 8px 12px; }
    .sheet-search input { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .profile-section { padding: 20px 0 30px; }
    .profile-header { padding: 16px; }
    .profile-avatar { width: 64px; height: 64px; font-size: 1.4rem; }
    .profile-info h1 { font-size: 1.1rem; }
    .profile-email { font-size: 0.8rem; }
    .profile-content { padding: 12px; border-radius: var(--radius); }
    .profile-card h3 { font-size: 0.95rem; }
    .info-item { padding: 10px 12px; }
    .info-value { font-size: 0.85rem; }
    .modal-content { padding: 16px; }
    .modal-header h3 { font-size: 0.95rem; }
    .modal-actions button { padding: 8px; font-size: 0.8rem; }
    .success-modal-content { padding: 24px 16px; width: 98%; }
    .success-icon { width: 56px; height: 56px; }
    .success-icon i { font-size: 1.8rem; }
    .success-modal-content h3 { font-size: 1.1rem; }
    .success-modal-content > p { font-size: 0.85rem; }
    .success-modal-buttons .btn-primary { padding: 10px 24px; font-size: 0.85rem; }
    .footer-links { grid-template-columns: 1fr; gap: 16px; }
    #customToast { bottom: 20px; font-size: 0.75rem; padding: 10px 20px; max-width: 90%; }
    .country-sheet { max-height: 80vh; height: 80vh; }
    .country-sheet .sheet-container { max-height: 80vh; height: 80vh; padding: 0 12px 12px; }
    .country-sheet-option { padding: 8px 12px; font-size: 0.8rem; }
    .country-sheet-option .flag { font-size: 1rem; width: 24px; }
    .country-sheet-option .country-code { font-size: 0.7rem; }
    .sheet-search { padding: 6px 10px; }
    .sheet-search input { font-size: 0.8rem; }
}

/* ---------- REMOVE FOCUS INDICATORS ---------- */
.country-input-wrapper input:focus,
.country-input-wrapper input:active,
.country-option:focus,
.country-option:active,
.country-sheet-option:focus,
.country-sheet-option:active,
#countrySearch,
#countrySheetSearch {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.country-input-wrapper input:focus {
    border-color: var(--violet) !important;
    box-shadow: 0 0 0 3px rgba(108, 43, 217, 0.1) !important;
}