/* ========== PROFILE BACKGROUND SYSTEM ========== */

.profile-background-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.profile-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.profile-background-video,
.profile-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7) blur(2px);
    transform: scale(1.05);
    transition: transform 20s ease-in-out;
}

.profile-background-video {
    animation: backgroundSlowZoom 30s ease-in-out infinite alternate;
}

@keyframes backgroundSlowZoom {
    0% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1.15);
    }
}

.profile-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.profile-background-overlay-none {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

.profile-background-overlay-weak {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.5) 100%
    );
}

.profile-background-overlay-medium {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.profile-background-overlay-strong {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

body.profile-with-background main.container {
    position: relative;
    z-index: 1;
    background: transparent;
}

body.profile-with-background .profile-content {
    margin-top: 10vh;
}

body.profile-with-background .profile-frame-border {
    position: relative;
    z-index: 2;
}

body.profile-with-background .profile-frame-inner {
    background: rgba(18, 20, 28, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.profile-with-background .profile-section {
    background: rgba(20, 22, 30, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.profile-with-background .profile-page {
    background: transparent;
    backdrop-filter: none;
    border: none;
}

@media (max-width: 768px) {
    .profile-background-container {
        height: 50vh;
    }

    body.profile-with-background .profile-content {
        margin-top: 5vh;
    }
}

/* ========== PROFILE FRAME DESIGN (v2) ========== */

.profile-content {
    position: relative;
    max-width: 850px;
    margin: 2rem auto;
    padding: 0 1rem;
    z-index: 1;
}

.profile-frame-border {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 3px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2)), rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.05);
    animation: frameGlow 3s ease-in-out infinite alternate;
}

@keyframes frameGlow {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.05);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), inset 0 0 30px rgba(255, 255, 255, 0.1);
    }
}

.profile-frame-inner {
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-photo-block {
    width: 100%;
    height: 200px;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.profile-info-block {
    margin-bottom: 12px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.profile-username {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-btn {
    font-size: 1.2rem;
    padding: 0.25rem;
    opacity: 0.7;
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
}

.settings-btn:hover {
    transform: rotate(15deg) scale(1.1);
    opacity: 1;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
}

.info-label {
    color: rgba(255, 255, 255, 0.7);
}

.info-value {
    font-weight: 600;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

.status-dot {
    font-size: 1rem;
    animation: statusPulse 2s ease-in-out infinite;
    display: inline-block;
}

.status-text {
    color: #2ecc71;
    font-weight: 500;
}

.contacts-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-top: 6px;
}

.frame-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    margin: 12px 0;
}

.profile-level-block {
    margin-bottom: 12px;
}

.level-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.level-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.level-number {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.exp-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.exp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffa500);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.exp-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.exp-text {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.exp-next {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.bonus-rules {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 6px;
}

.bonus-rules div {
    margin-bottom: 3px;
}

.profile-stats-block {
    text-align: center;
}

.stats-header {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.stats-line {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-num {
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
}

.stat-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.stat-sep {
    color: rgba(255, 255, 255, 0.5);
}

.add-friend-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-friend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@media (max-width: 768px) {
    .profile-photo-block {
        height: 150px;
    }

    .profile-username {
        font-size: 1.2rem;
    }

    .profile-frame-inner {
        padding: 16px;
    }

    .stats-line {
        font-size: 0.85rem;
        gap: 4px;
    }

    .stat-num {
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile-background-video,
    .profile-background-image {
        animation: none !important;
        transform: scale(1.05) !important;
    }
}

/* Global phone downscale override for profile page */
@media (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-small,
    button,
    input[type="button"],
    input[type="submit"],
    input[type="reset"] {
        font-size: 0.92rem !important;
        padding: 0.5rem 0.9rem !important;
    }

    .manga-card,
    .trade-card,
    .reader-card {
        border-radius: 14px;
    }

    .manga-card-title,
    .profile-username {
        font-size: 0.96rem;
    }
}

@media (max-width: 480px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-small,
    button,
    input[type="button"],
    input[type="submit"],
    input[type="reset"] {
        font-size: 0.88rem !important;
        padding: 0.45rem 0.8rem !important;
    }
}
