/* --- ЗМІННІ ТЕМИ --- */
:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #10b981;
    --bg-page: #050505;
    --bg-card: #111111;
    --bg-input: #1a1a1a;
    --border: #333333;
    --text-main: #ffffff;
    --text-muted: #888888;
    --radius: 16px;
    --gradient-main: linear-gradient(135deg, #8b5cf6, #3b82f6);
    --gradient-gold: linear-gradient(135deg, #FFD700, #FFA500);
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- LAYOUT --- */
.profile-wrapper {
    max-width: 1200px;
    margin: 100px auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    align-items: start;
}

/* --- ЛІВИЙ САЙДБАР --- */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border);
    text-align: center;
    position: sticky;
    top: 100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Аватар */
.avatar-container {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 15px;
}

.avatar-glow {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--gradient-main);
    filter: blur(15px);
    opacity: 0.5;
    animation: pulse 3s infinite ease-in-out;
}

.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    border: 4px solid var(--bg-card);
    background: #222;
}

.status-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    background: #555;
    z-index: 2;
}
.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

@keyframes pulse {
    0% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 0.7; transform: scale(1.05); }
    100% { opacity: 0.4; transform: scale(0.95); }
}

/* 🔥 ВИПРАВЛЕНО: Інфо про продавця (Галочка в рядок) 🔥 */
.seller-header {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px; /* Відстань між ніком і галочкою */
    flex-wrap: wrap;
}

.seller-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    word-break: break-word;
    line-height: 1.2;
    margin: 0;
}

.badge-verified {
    color: #3b82f6;
    font-size: 1.2rem;
    display: flex; /* Щоб іконка центрувалась */
    align-items: center;
}

.seller-rating {
    color: #fbbf24;
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.role-badges {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.role {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

/* 🔥 Стилі для ролей (Жовтий OWNER) 🔥 */
.role.owner { 
    background: rgba(255, 215, 0, 0.15); 
    color: #ffd700; /* Золотий */
    border: 1px solid rgba(255, 215, 0, 0.5); 
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}
.role.admin { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
    border: 1px solid rgba(239, 68, 68, 0.3); 
}
.role.moderator { 
    background: rgba(16, 185, 129, 0.1); 
    color: #10b981; 
    border: 1px solid rgba(16, 185, 129, 0.3); 
}
.role.seller { 
    background: rgba(139, 92, 246, 0.1); 
    color: #8b5cf6; 
    border: 1px solid rgba(139, 92, 246, 0.3); 
}
.role.user { 
    background: rgba(255, 255, 255, 0.05); 
    color: #aaa; 
    border: 1px solid #444; 
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 15px 0;
    width: 100%;
}

/* Список інформації */
.info-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.info-item:hover {
    border-color: #333;
    background: rgba(255, 255, 255, 0.05);
}

.info-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
    word-break: break-all; 
    line-height: 1.3;
}

.email-blur {
    cursor: text;
    user-select: all;
}

/* Кнопки */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
    font-size: 0.95rem;
    margin-top: 15px;
}

.contact-btn {
    background: var(--primary);
    color: white;
}
.contact-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.report-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px;
    margin-top: 8px;
}
.report-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* --- ПРАВА ЧАСТИНА --- */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ads-count {
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: white;
    border: 1px solid #333;
}

.custom-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    cursor: pointer;
}

/* СІТКА ТОВАРІВ */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.3);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: #080808;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.card-badge.premium {
    background: var(--gradient-gold);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-cat {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: auto;
    padding-bottom: 10px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #222;
    padding-top: 12px;
    margin-top: 5px;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
}

.buy-btn-sm {
    background: var(--bg-input);
    border: 1px solid #333;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.buy-btn-sm:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.loader-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}
.loader-container i { font-size: 2rem; color: var(--primary); margin-bottom: 10px; }

/* АДАПТИВ */
@media (max-width: 900px) {
    .profile-wrapper {
        grid-template-columns: 1fr;
        margin-top: 80px;
    }
    
    .profile-card {
        position: static;
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: flex-start;
        text-align: left;
        gap: 20px;
    }

    .avatar-container { margin: 0; width: 100px; height: 100px; }
    .seller-header, .seller-rating, .role-badges { justify-content: flex-start; }
    
    .info-list {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-top: 10px;
        padding-top: 15px;
        border-top: 1px solid #333;
    }
    
    .contact-btn, .report-btn { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100%;
    }

    .profile-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 0 12px 40px;
        box-sizing: border-box;
    }

    .profile-card {
        padding: 16px;
    }

    .seller-name {
        font-size: 1.25rem;
        word-break: break-word;
    }

    .section-title {
        font-size: 1.15rem;
        word-break: break-word;
    }

    .ads-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .card-body {
        padding: 12px;
    }

    .action-btn,
    .contact-btn,
    .report-btn {
        min-height: 44px;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .profile-card {
        display: block;
        text-align: center;
    }
    
    .avatar-container { margin: 0 auto 15px; }
    .seller-header, .seller-rating, .role-badges { justify-content: center; }
    
    .info-list {
        grid-template-columns: 1fr;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
}