/* ====================================
   VISIBLE BANNER PROFILE (Twitter/X Style)
   ==================================== */

:root {
    --gold: #ffd700;
    --gold-dark: #ffa500;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.user-profile-modern {
    min-height: 100vh;
    background: var(--bg-dark);
}

/* ====================================
   BANNER - FULLY VISIBLE
   ==================================== */

.profile-banner-full {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-default {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
}

.banner-camera-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.banner-camera-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* ====================================
   PROFILE INFO SECTION - BELOW BANNER
   ==================================== */

.profile-info-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

.profile-info-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
}

/* Avatar - Overlaps Banner (Negative Margin) */
.profile-avatar-overlap {
    position: relative;
    margin-top: -80px;
    /* Overlaps banner by 80px */
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.profile-avatar-overlap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid var(--bg-dark);
    background: var(--bg-card);
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.avatar-camera-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--gold);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.avatar-camera-btn:hover {
    background: var(--gold);
    color: black;
}

/* Action Buttons - Top Right */
.profile-actions-top {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
}

.btn-edit-modern,
.btn-logout-modern {
    padding: 0.625rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-edit-modern {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    color: black;
}

.btn-edit-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.5);
}

.btn-logout-modern {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-logout-modern:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ====================================
   PROFILE DETAILS - ALL BELOW BANNER
   ==================================== */

.profile-details-section {
    padding: 1rem 0 2rem;
}

.profile-display-name {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.profile-handle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

.profile-badges-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.fame-badge,
.role-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fame-badge.top-creator {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
}

.fame-badge.rising-star {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.fame-badge.contestant {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.fame-badge.newcomer {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.role-badge.regular {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.role-badge.contestant {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.profile-bio-section {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.profile-bio-section p {
    margin: 0;
    flex: 1;
}

.bio-empty {
    color: var(--text-muted);
    font-style: italic;
}

.bio-edit-mini {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.bio-edit-mini:hover {
    color: var(--gold);
}

/* Stats Row */
.profile-stats-modern {
    display: flex;
    gap: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.stat-item {
    display: flex;
    gap: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-item:hover .stat-number {
    color: var(--gold);
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.stat-text {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* ====================================
   TABS SECTION
   ==================================== */

.profile-tabs-section {
    border-bottom: 1px solid var(--border);
    max-width: 1200px;
    margin: 0 auto;
}

.tabs-container {
    display: flex;
    gap: 0;
    padding: 0 2rem;
}

.profile-tab {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.profile-tab:hover {
    color: var(--text-primary);
}

.profile-tab.active {
    color: var(--gold);
}

.profile-tab.active::after {
    transform: scaleX(1);
}

/* ====================================
   CONTENT AREA
   ==================================== */

.profile-content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Posts Grid */
.posts-grid-clean {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.post-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.post-item:hover {
    transform: scale(1.02);
}

.post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-item:hover .post-hover {
    opacity: 1;
}

.post-stats {
    display: flex;
    gap: 1.5rem;
    color: white;
    font-weight: 600;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Contests Grid */
.contests-grid-clean {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.contest-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contest-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.contest-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.contest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contest-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: rgba(255, 255, 255, 0.3);
}

.contest-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.contest-badge.active {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.contest-badge.completed {
    background: rgba(148, 163, 184, 0.9);
    color: white;
}

.contest-badge.upcoming {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.contest-badge.ended {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.contest-meta {
    padding: 1.25rem;
}

.contest-meta h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contest-meta p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Empty State */
.empty-content {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-content svg {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.empty-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.cta-btn-clean {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 12px;
    color: black;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-btn-clean:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4);
}

/* ====================================
   RESPONSIVE
   ==================================== */

@media (max-width: 768px) {
    .profile-banner-full {
        height: 200px;
    }

    .profile-info-section {
        padding: 0 1rem;
    }

    .profile-info-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-avatar-overlap {
        margin-top: -60px;
        width: 120px;
        height: 120px;
    }

    .profile-actions-top {
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.5rem;
    }

    .profile-display-name {
        font-size: 1.5rem;
    }

    .profile-stats-modern {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .tabs-container {
        padding: 0 1rem;
    }

    .profile-content-area {
        padding: 1rem;
    }

    .posts-grid-clean {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .contests-grid-clean {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {

    .btn-edit-modern span,
    .btn-logout-modern svg:last-child {
        display: none;
    }

    .btn-edit-modern,
    .btn-logout-modern {
        padding: 0.625rem;
    }

    .profile-tab {
        padding: 1rem;
        font-size: 0.875rem;
    }

    .profile-tab svg {
        width: 16px;
        height: 16px;
    }

    .stat-number,
    .stat-text {
        font-size: 1rem;
    }
}

/* ====================================
   EDIT PROFILE MODAL - DARK THEME
   ==================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: #1e293b;
    /* Dark background */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    max-width: 550px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    margin: 2rem auto;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input[readonly] {
    background: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
    color: #94a3b8;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23f1f5f9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

/* Avatar Preview */
.avatar-preview {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ffd700;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
.btn-secondary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffd700;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-actions .btn-secondary {
    flex: 1;
    width: auto;
}

.save-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    border: none;
    border-radius: 12px;
    color: black;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.5);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Social Modal Specific Styles */
.social-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.social-list::-webkit-scrollbar {
    width: 8px;
}

.social-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.social-list::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.social-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

.social-user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.social-user-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.social-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #ffd700;
    object-fit: cover;
}

.social-user-info {
    flex: 1;
}

.social-user-name {
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.social-user-username {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.no-content {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.no-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.no-content p {
    font-size: 1rem;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
        align-items: flex-start;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem auto;
        max-width: 100%;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .avatar-preview {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .close-modal {
        width: 32px;
        height: 32px;
    }

    .form-group input[type="text"],
    .form-group input[type="date"],
    .form-group input[type="email"],
    .form-group select {
        padding: 0.75rem;
    }
}

/* Body Scroll Lock */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Smooth scrolling for modal */
.modal {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}