/* ==========================================
   OFFEYES — PREMIUM PROFILES STYLESHEET
   ========================================== */

/* PROFILE HERO */
.profile-hero {
    position: relative;
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

@keyframes heroGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-hero-bg {
    height: 140px;
    background: linear-gradient(135deg, var(--accent) 0%, #ec4899 50%, #1e1b4b 100%);
    background-size: 200% 200%;
    animation: heroGradient 10s ease infinite;
    position: relative;
}

.profile-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.5) 0%, transparent 60%);
    opacity: 0.8;
}

.profile-hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 32px 32px;
    margin-top: -50px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    gap: 20px;
}

.profile-hero-left {
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.hero-avatar-wrap {
    position: relative;
}

.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background-color: var(--bg-surface-active);
    border: 4px solid var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.hero-level-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface-active);
    padding: 2px;
    border-radius: 20px;
    border: 2px solid var(--bg-surface);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.lvl-inner {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.hero-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 4px;
}

.hero-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-username {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.hero-flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-elo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--accent-muted);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.hero-elo-badge svg {
    color: var(--accent);
}

.hero-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hero-date svg {
    color: var(--text-tertiary);
}

.hero-actions {
    padding-bottom: 8px;
}

.hero-btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-surface-active);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hero-btn-edit:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.hero-btn-edit:active {
    transform: translateY(1px);
}

/* STATS GRID */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.pstat-card {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pstat-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 12px var(--accent-muted);
}

.pstat-elo::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, #ec4899 100%);
}

.pstat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface-active);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pstat-data {
    display: flex;
    flex-direction: column;
}

.pstat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.pstat-value.accent { color: var(--accent); }
.pstat-value.green { color: #22c55e; }
.pstat-value.red { color: #ef4444; }
.pstat-value.yellow { color: #f59e0b; }
.pstat-value.purple { color: #a78bfa; }
.pstat-value.cyan { color: #06b6d4; }

.pstat-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.pstat-trend {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.pstat-trend.positive {
    background-color: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.pstat-trend.negative {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* BOTTOM LAYOUT GRID */
.profile-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.panel {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.panel-head {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ADVANCED ELO PROGRESS */
.elo-progress-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.elo-adv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.elo-adv-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.elo-adv-tier {
    display: flex;
    flex-direction: column;
}
.elo-adv-tier span {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.elo-adv-tier small {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
}
.elo-adv-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.elo-adv-needed {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.elo-adv-needed strong {
    color: var(--lvl-color, var(--accent));
    font-size: 0.95rem;
}
.elo-adv-est {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    background-color: var(--bg-surface-active);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}
.elo-adv-est strong {
    color: #22c55e;
}

.elo-adv-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
}
.elo-adv-limit {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 32px;
}
.elo-adv-limit:last-child {
    text-align: right;
}
.elo-adv-bar {
    flex: 1;
    height: 14px;
    background-color: #0f1115;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.elo-adv-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, var(--lvl-color, var(--accent)) 100%);
    border-radius: 8px;
    position: relative;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.elo-adv-glow {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8));
    filter: blur(4px);
}

/* WINRATE SECTION */
.winrate-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.winrate-ring-wrap {
    position: relative;
    width: 120px;
    height: 120px;
}

.winrate-ring {
    width: 100%;
    height: 100%;
}

.winrate-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.winrate-pct {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.winrate-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.winrate-legend {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.wl-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.wl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.wl-item strong {
    margin-left: auto;
    color: var(--text-primary);
}

/* MATCH HISTORY */
.match-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface-active);
    border: 1px solid var(--border);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.match-item:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.match-item.victory::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 4px;
    background-color: #22c55e;
}

.match-item.defeat::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 4px;
    background-color: #ef4444;
}

.match-result-badge {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 72px;
    text-align: center;
}

.match-result-badge.win {
    background-color: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.match-result-badge.loss {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.match-game-mode {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
}

.mode-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.mode-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.match-stats {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 32px;
}

.mstat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.mstat-val {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.mstat-lbl {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.match-elo-change {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 64px;
    margin-left: 32px;
}

.elo-chg {
    font-weight: 800;
    font-size: 1rem;
}

.elo-chg.up { color: #22c55e; }
.elo-chg.down { color: #ef4444; }

.elo-total {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 1px;
}

/* EMPTY STATE */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--text-tertiary);
}

.empty-state p {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.empty-state-btn {
    background-color: var(--accent);
    color: var(--text-primary);
    padding: 8px 24px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.empty-state-btn:hover {
    background-color: var(--accent-hover);
}

/* OVERLAY & MODAL */
.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.clean-modal {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    margin: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay.active .clean-modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-icon {
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: var(--bg-surface-active);
    color: var(--text-primary);
}

.edit-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clean-input {
    background-color: var(--bg-surface-active);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.clean-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.clean-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.edit-btn-cancel {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn-cancel:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.edit-btn-save {
    background-color: var(--accent);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn-save:hover {
    background-color: var(--accent-hover);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .profile-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-hero-content {
        padding: 0 20px 20px;
        margin-top: -40px;
        justify-content: center;
        text-align: center;
    }

    .profile-hero-left {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .hero-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }

    .hero-info {
        align-items: center;
    }

    .hero-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hero-btn-edit {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}
