/* ========================================
   Profile Page - Compact 3-Column Layout
   ======================================== */

/* === Main Grid === */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* === Profile Card === */
.profile-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
}

.profile-card.compact {
    padding: 12px 15px;
}

/* === Header Row === */
.profile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

/* === Currency Row === */
.currency-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.currency-badge {
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
}

/* === Card Header === */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(76, 175, 80, 0.4);
    transform: scale(1.1);
}

/* === Platforms Compact === */
.platforms-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.platform-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
}

.platform-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.platform-icon {
    font-size: 16px;
}

.platform-name {
    font-size: 13px;
    color: var(--text-primary);
}

.platform-unlink {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 12px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.platform-unlink:hover {
    opacity: 1;
    color: #f44336;
}

/* === Tops Section === */
.tops-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.top-tab {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: rgba(0,0,0,0.2);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.top-tab:hover {
    background: rgba(255,255,255,0.1);
}

.top-tab.active {
    background: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.top-position-display {
    text-align: center;
    margin-bottom: 5px;
}

.top-rank {
    font-size: 48px;
    font-weight: 700;
    color: #ffd700;
    line-height: 1;
}

.top-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 5px;
}

.top-value-display {
    text-align: center;
}

.top-value {
    font-size: 14px;
    color: var(--text-secondary);
}

/* === Pet Card === */
.pet-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pet-display {
    text-align: center;
}

.pet-avatar {
    font-size: 48px;
    margin-bottom: 5px;
}

.pet-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.pet-level {
    font-size: 13px;
    color: var(--text-muted);
}

/* === Pet Stats === */
.pet-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pet-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.stat-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-bar.food { background: linear-gradient(90deg, #8bc34a, #aed581); }
.stat-bar.mood { background: linear-gradient(90deg, #ff9800, #ffc107); }
.stat-bar.sleep { background: linear-gradient(90deg, #2196f3, #64b5f6); }

.stat-value {
    font-size: 11px;
    color: var(--text-muted);
    width: 30px;
    text-align: right;
}

/* === Secret Hash Section === */
.secret-hash-display {
    background: rgba(0,0,0,0.3);
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow-x: auto;
}

.secret-hash-display code {
    font-family: monospace;
    font-size: 11px;
    color: #4cafff;
    word-break: break-all;
    user-select: all;
}

.secret-hash-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* === Merge Input Section === */
.merge-section {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
    margin-top: 10px;
}

.merge-input-group {
    display: flex;
    gap: 8px;
}

.merge-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: monospace;
}

.merge-input:focus {
    outline: none;
    border-color: rgba(76, 175, 80, 0.5);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* === Merge Modal === */
.modal-md {
    max-width: 600px;
}

.merge-description {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.merge-accounts-compare {
    display: flex;
    gap: 15px;
    align-items: stretch;
    margin-bottom: 15px;
}

.merge-account-card {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.merge-account-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.merge-account-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.merge-account-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.merge-pet-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.merge-pet-info .pet-emoji {
    font-size: 20px;
}

.merge-pet-info .pet-details {
    font-size: 13px;
    color: var(--text-secondary);
}

.merge-currency {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-primary);
}

.merge-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 24px;
}

.merge-platform-badge {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border-radius: 10px;
}

.merge-vs {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
}

.merge-choose-btn {
    margin-top: auto;
}

.merge-warning {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    color: #ffc107;
    font-size: 13px;
}

.merge-info {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.merge-info p {
    margin: 0 0 8px 0;
}

.merge-info ul {
    margin: 0;
    padding-left: 20px;
}

.merge-info li {
    margin: 4px 0;
}

/* === Modal Small === */
.modal-sm {
    max-width: 350px;
}

.link-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.link-code {
    font-size: 24px;
    font-weight: 700;
    color: #4cafff;
    font-family: monospace;
    letter-spacing: 2px;
}

.link-instructions {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}

.link-instructions p {
    margin: 5px 0;
    font-size: 13px;
}

.link-instructions code {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    padding: 2px 6px;
    border-radius: 4px;
}

.link-timer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* === Error Message === */
.error-message {
    padding: 10px 12px;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    color: #f44336;
    font-size: 13px;
}

/* === Modal Close === */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.modal-content {
    position: relative;
}

/* === Responsive === */
@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-column:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-column:last-child {
        grid-column: span 1;
    }

    .tops-tabs {
        flex-wrap: wrap;
    }

    .top-rank {
        font-size: 36px;
    }

    /* Merge modal responsive */
    .merge-accounts-compare {
        flex-direction: column;
    }

    .merge-vs {
        justify-content: center;
        padding: 10px 0;
    }

    .modal-md {
        max-width: 95%;
        margin: 10px;
    }

    .merge-input-group {
        flex-direction: column;
    }

    .secret-hash-display code {
        font-size: 10px;
    }
}

/* === OAuth Buttons === */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.oauth-label {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 5px 0;
    text-align: center;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.oauth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.oauth-icon {
    font-size: 18px;
}

.oauth-vk {
    background: linear-gradient(135deg, #0077FF 0%, #0055CC 100%);
    color: white;
}

.oauth-vk:hover {
    background: linear-gradient(135deg, #0088FF 0%, #0066DD 100%);
}

.oauth-telegram {
    background: linear-gradient(135deg, #0088CC 0%, #0066AA 100%);
    color: white;
}

.oauth-telegram:hover {
    background: linear-gradient(135deg, #0099DD 0%, #0077BB 100%);
}

.oauth-goodgame {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
}

.oauth-goodgame:hover {
    background: linear-gradient(135deg, #5DBF61 0%, #43A047 100%);
}

/* === Login Divider === */
.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.login-divider span {
    padding: 0 15px;
}

/* === Link Platform Button (Link) === */
.platform-link-btn {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.platform-link-btn:hover {
    background: rgba(76, 175, 80, 0.4);
}

/* === Unlink Platform Button (Red) === */
.platform-unlink-btn {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-unlink-btn:hover {
    background: rgba(244, 67, 54, 0.3);
}

/* === Auth Platform Badge === */
.auth-badge {
    color: #4caf50;
    font-size: 12px;
    margin-left: 6px;
}

.platform-auth-hint {
    color: var(--text-muted);
    font-size: 11px;
    padding: 6px 12px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 6px;
}

/* === Pet Warning on Link === */
.pet-warning-modal {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.pet-warning-modal strong {
    color: #ffc107;
}

.pet-warning-modal p {
    margin: 8px 0 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* === Link Modal OAuth Buttons === */
.link-oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.link-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-oauth-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.link-oauth-btn:hover:not(.disabled) {
    transform: translateY(-1px);
}

/* === Telegram Button Style === */
.btn-telegram {
    background: linear-gradient(135deg, #0088cc, #0066aa) !important;
}

.btn-telegram:hover:not(:disabled) {
    background: linear-gradient(135deg, #0077bb, #005599) !important;
}

/* === Login Buttons Links === */
.login-buttons a.btn {
    text-decoration: none;
    width: 100%;
}

/* ========================================
   Merge Accounts Modal (Large)
   ======================================== */

.modal-lg {
    max-width: 700px;
    width: 95%;
}

.merge-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.merge-accounts-grid {
    display: flex;
    gap: 15px;
    align-items: stretch;
    margin-bottom: 20px;
}

.merge-account-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.merge-account-card:hover {
    border-color: rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.merge-account-card.selected {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.account-card-header {
    display: flex;
    justify-content: flex-start;
}

.account-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.account-badge.current {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

.account-badge.conflict {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.account-username {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.account-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.account-pet {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin: 5px 0;
}

.account-pet .pet-emoji {
    font-size: 24px;
}

.account-pet .pet-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.account-pet.has-pet .pet-info {
    color: var(--text-primary);
}

.account-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-primary);
}

.account-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.account-platforms .platform-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border-radius: 8px;
}

.merge-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 5px;
}

.merge-warning {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.merge-warning strong {
    color: #ffc107;
    font-size: 14px;
}

.merge-warning ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.merge-warning li {
    margin: 5px 0;
}

.merge-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.merge-actions .btn {
    padding: 10px 20px;
}

#confirmMergeBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive for merge modal */
@media (max-width: 600px) {
    .merge-accounts-grid {
        flex-direction: column;
    }

    .merge-vs {
        padding: 10px 0;
    }

    .modal-lg {
        max-width: 95%;
    }

    .merge-actions {
        flex-direction: column-reverse;
    }

    .merge-actions .btn {
        width: 100%;
    }
}

/* ========================================
   Top-10 Leaderboard List
   ======================================== */

.top-list {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.top-list-header {
    display: grid;
    grid-template-columns: 40px 55px 1fr 65px;
    gap: 5px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.top-list-row {
    display: grid;
    grid-template-columns: 40px 55px 1fr 65px;
    gap: 5px;
    padding: 8px 12px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.top-list-row:last-child {
    border-bottom: none;
}

.top-list-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.top-list-row.is-me {
    background: rgba(76, 175, 80, 0.15);
}

.top-list-row.is-me:hover {
    background: rgba(76, 175, 80, 0.25);
}

.top-col-pos {
    font-weight: 700;
    text-align: center;
}

.top-col-id {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
}

.top-col-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.top-col-value {
    text-align: right;
    font-weight: 600;
    color: #4caf50;
}

.top-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
