@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

body {
    background: #F4F3EF;
    font-family: 'Inter', sans-serif;
    color: #1A1A1A;
    line-height: 1.4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 24px 0;
    border-bottom: 1px solid #E2DFD7;
    margin-bottom: 32px;
    position: relative;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #1A1A1A;
}

.logo-accent {
    color: #A87B4A;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-link {
    color: #5A5A5A;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #A87B4A;
}

.nav-link.active {
    color: #A87B4A;
    font-weight: 600;
}

/* MOBILE MENU */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #1A1A1A;
}

/* MARKETPLACE LAYOUT */
.marketplace-layout {
    display: flex;
    gap: 30px;
}

.main-content {
    flex: 3;
}

.platform-sidebar {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #E2DFD7;
    height: fit-content;
}

.platform-title {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 14px;
}

.platform-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.platform-chip {
    background: #F4F3EF;
    border-radius: 30px;
    padding: 8px 15px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}

.platform-chip.active {
    background: #1A1A1A;
    color: white;
}

/* SEARCH */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E2DFD7;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    outline: none;
}

.search-input:focus {
    border-color: #A87B4A;
}

.search-select {
    padding: 12px 16px;
    border: 1px solid #E2DFD7;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    outline: none;
    min-width: 150px;
    cursor: pointer;
}

.search-select:focus {
    border-color: #A87B4A;
}

.search-btn {
    padding: 12px 28px;
    background: #1A1A1A;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
}

/* ACCOUNTS GRID */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.account-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #E9E7E2;
    transition: 0.2s;
    cursor: pointer;
}

.account-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.account-platform {
    font-size: 11px;
    font-weight: 600;
    color: #A87B4A;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.account-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.account-price {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.seller-info {
    font-size: 13px;
    color: #8A8A8A;
    padding-top: 12px;
    border-top: 1px solid #EFEDE8;
    margin-bottom: 16px;
}

.btn-view {
    width: 100%;
    padding: 10px;
    background: #F4F3EF;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
}

/* Кнопки покупки в карточке */
.buy-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.buy-actions .btn-view {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

.btn-view.buy-now {
    background: #1A1A1A;
    color: white;
}

.btn-view.buy-now:hover {
    background: #333;
}

.btn-view.buy-guarantee {
    background: #A87B4A;
    color: white;
}

.btn-view.buy-guarantee:hover {
    background: #C4935A;
}

/* PROFILE */
.profile-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 32px;
    border: 1px solid #E9E7E2;
}

.profile-balance {
    font-size: 18px;
    font-weight: 500;
    margin: 20px 0 24px 0;
}

.profile-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #D1CEC6;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: #A87B4A;
    color: #A87B4A;
}

/* SELL FORM */
.form-card {
    max-width: 520px;
    background: white;
    border-radius: 24px;
    padding: 32px;
    margin: 0 auto;
    border: 1px solid #E9E7E2;
}

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 20px;
    border: 1px solid #E2DFD7;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #A87B4A;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #1A1A1A;
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}

/* PLATFORM OVALS */
.platform-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.platform-oval {
    background: #F4F3EF;
    border: 1px solid #E2DFD7;
    border-radius: 40px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
}

.platform-oval.selected {
    background: #1A1A1A;
    color: white;
    border-color: #A87B4A;
}

/* REVIEWS */
.reviews-list {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #E2DFD7;
}

.review-item {
    padding: 12px 0;
    border-bottom: 1px solid #EFEDE8;
}

.review-rating {
    color: #A87B4A;
    font-weight: 600;
}

.review-meta {
    font-size: 12px;
    color: #8A8A8A;
}

/* TICKETS */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #E2DFD7;
    cursor: pointer;
    transition: 0.2s;
}

.ticket-card:hover {
    border-color: #A87B4A;
}

.ticket-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.ticket-status.open {
    background: #D4EDDA;
    color: #155724;
}

.ticket-status.closed {
    background: #F8D7DA;
    color: #721C24;
}

.ticket-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.ticket-message {
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #F4F3EF;
}

.ticket-message.support {
    background: #E2DFD7;
}

.ticket-meta {
    font-size: 11px;
    color: #8A8A8A;
}

/* MODALS */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 28px;
    width: 90%;
    max-width: 480px;
    position: relative;
}

.close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #8A8A8A;
}

.close:hover {
    color: #1A1A1A;
}

.deposit-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: #F4F3EF;
    border: none;
    border-radius: 30px;
    cursor: pointer;
}

.tab-btn.active {
    background: #1A1A1A;
    color: white;
}

.wallet-address {
    background: #F4F3EF;
    padding: 12px;
    border-radius: 12px;
    margin-top: 12px;
}

.image-preview img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 12px;
}

.loading-state {
    text-align: center;
    padding: 60px;
    color: #8A8A8A;
}

/* ========== ACCOUNT DETAIL ========== */
.account-detail {
    max-width: 900px;
    margin: 40px auto;
}
.detail-card {
    display: flex;
    gap: 30px;
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #E2DFD7;
}
.detail-image {
    flex: 1;
}
.detail-image img {
    max-width: 100%;
    border-radius: 16px;
}
.detail-info {
    flex: 2;
}
.detail-platform {
    font-size: 12px;
    color: #A87B4A;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.detail-title {
    font-size: 28px;
    margin: 8px 0;
}
.detail-price {
    font-size: 32px;
    font-weight: 700;
    color: #1A1A1A;
}
.detail-description {
    margin: 16px 0;
    color: #4A4A4A;
}
.detail-seller {
    color: #8A8A8A;
}
.credentials {
    background: #F4F3EF;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 12px;
}

/* ========== USER TOAST ========== */
.user-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #155724;
    color: white;
    padding: 14px 24px;
    border-radius: 16px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 400px;
}
.user-toast.error {
    background: #721C24;
}

/* ========== КАСТОМНЫЕ МОДАЛЬНЫЕ ОКНА ========== */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: customModalFadeIn 0.3s ease;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.custom-modal-box {
    position: relative;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 32px;
    max-width: 460px;
    width: 92%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    animation: customModalSlideUp 0.3s ease;
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.custom-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #8A8A8A;
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.2s;
}

.custom-modal-close:hover {
    color: #1A1A1A;
}

.custom-modal-body {
    margin-bottom: 24px;
}

.custom-modal-body p {
    font-size: 15px;
    color: #4A4A4A;
    line-height: 1.6;
    margin: 0;
}

.custom-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2DFD7;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    margin-top: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.custom-modal-input:focus {
    border-color: #A87B4A;
}

.custom-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-modal-btn-primary {
    background: #1A1A1A;
    color: white;
}

.custom-modal-btn-primary:hover {
    background: #333333;
}

.custom-modal-btn-secondary {
    background: #F4F3EF;
    color: #4A4A4A;
}

.custom-modal-btn-secondary:hover {
    background: #E8E5DE;
}

@keyframes customModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes customModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Тёмная тема для модалок (под дизайн) */
.custom-modal-box.dark {
    background: #1E1E2F;
    border: 1px solid #33334A;
}

.custom-modal-box.dark .custom-modal-header h3 {
    color: #FFFFFF;
}

.custom-modal-box.dark .custom-modal-body p {
    color: #C0C0D0;
}

.custom-modal-box.dark .custom-modal-input {
    background: #2A2A40;
    border-color: #444466;
    color: white;
}

.custom-modal-box.dark .custom-modal-input:focus {
    border-color: #A87B4A;
}

.custom-modal-box.dark .custom-modal-btn-primary {
    background: #A87B4A;
    color: white;
}

.custom-modal-box.dark .custom-modal-btn-primary:hover {
    background: #C4935A;
}

.custom-modal-box.dark .custom-modal-btn-secondary {
    background: #33334A;
    color: #C0C0D0;
}

.custom-modal-box.dark .custom-modal-btn-secondary:hover {
    background: #444466;
}

.custom-modal-box.dark .custom-modal-close {
    color: #8888AA;
}

.custom-modal-box.dark .custom-modal-close:hover {
    color: #FFFFFF;
}

/* ========== АГЕНТЫ В МОДАЛКЕ ========== */
.agent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #E2DFD7;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.agent-item:hover {
    border-color: #A87B4A;
    background: #F8F7F4;
}

.agent-item.selected {
    border-color: #A87B4A;
    background: #F0EBE3;
}

.agent-item .agent-name {
    font-weight: 600;
}

.agent-item .agent-fee {
    font-size: 12px;
    color: #8A8A8A;
}

/* ========== ЗВЁЗДЫ ДЛЯ РЕЙТИНГА ========== */
#starRating span {
    transition: color 0.2s;
    cursor: pointer;
}

#starRating span:hover,
#starRating span.active {
    color: #F5C518;
}

/* ========== СЕЛЕКТОР ЯЗЫКА ========== */
.lang-select {
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid #E2DFD7;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    min-width: 120px;
}

.lang-select:focus {
    border-color: #A87B4A;
}

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav {
        display: none;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        padding: 16px 0;
        background: white;
        border-radius: 16px;
        margin-top: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        z-index: 999;
        border: 1px solid #E2DFD7;
    }

    .nav.open {
        display: flex;
    }

    .nav-link {
        padding: 12px 20px;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #EFEDE8;
        font-size: 15px;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .lang-select {
        width: 100%;
        padding: 10px 14px;
        font-size: 14px;
        margin-top: 4px;
        min-width: unset;
    }

    .header {
        flex-wrap: wrap;
        position: relative;
        padding-bottom: 12px;
    }

    .container {
        padding: 16px;
    }

    .marketplace-layout {
        flex-direction: column-reverse;
    }

    .platform-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
        margin-bottom: 16px;
        height: auto;
    }

    .platform-title {
        width: 100%;
        margin-bottom: 4px;
    }

    .platform-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .platform-chip {
        font-size: 12px;
        padding: 6px 14px;
    }

    .main-content {
        width: 100%;
    }

    .search-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-input {
        flex: 1 1 100%;
        font-size: 16px;
    }

    .search-select {
        min-width: 100%;
        font-size: 16px;
        flex: 1;
    }

    .search-btn {
        flex: 1;
        padding: 12px;
    }

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

    .buy-actions {
        flex-direction: column;
    }
    
    .buy-actions .btn-view {
        width: 100%;
        padding: 10px;
        font-size: 13px;
    }

    .profile-card {
        padding: 16px;
    }

    .profile-actions {
        flex-wrap: wrap;
    }

    .profile-actions .btn-secondary {
        flex: 1;
        text-align: center;
        min-width: 100px;
    }

    .form-card {
        padding: 16px;
        margin: 0 4px;
        border-radius: 16px;
    }

    input, select, textarea {
        font-size: 16px !important;
        padding: 12px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    .platform-selector {
        gap: 8px;
        margin-bottom: 16px;
    }

    .platform-oval {
        font-size: 13px;
        padding: 6px 14px;
        border-radius: 30px;
    }

    .ticket-card {
        padding: 12px;
    }

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

    .reply-form textarea {
        min-height: 60px;
        font-size: 16px !important;
    }

    .reply-form .btn {
        width: 100%;
        padding: 12px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px auto;
        max-width: 100%;
        border-radius: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .deposit-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .deposit-tabs .tab-btn {
        flex: 1 1 45%;
        padding: 10px;
        font-size: 13px;
    }

    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .close {
        font-size: 28px;
        top: 12px;
        right: 16px;
    }

    .user-toast {
        bottom: 20px !important;
        right: 16px !important;
        left: 16px !important;
        max-width: none !important;
        text-align: center;
        font-size: 14px !important;
        padding: 14px !important;
        border-radius: 14px !important;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .section h3 {
        font-size: 15px;
    }

    #sellPage .form-card h2 {
        font-size: 20px;
        margin-bottom: 16px;
        text-align: center;
    }

    /* DETAIL CARD */
    .detail-card {
        flex-direction: column;
    }
    .detail-image {
        flex: none;
    }

    /* Модалки на мобилках */
    .custom-modal-box {
        padding: 24px 20px;
        width: 95%;
        max-width: 100%;
        margin: 16px;
        border-radius: 20px;
    }

    .custom-modal-header h3 {
        font-size: 18px;
    }

    .custom-modal-body p {
        font-size: 14px;
    }

    .custom-modal-btn {
        padding: 10px 20px;
        font-size: 13px;
        flex: 1;
        text-align: center;
    }

    .custom-modal-footer {
        gap: 8px;
    }

    .custom-modal-input {
        font-size: 16px !important;
        padding: 12px;
    }

    .agent-item {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }

    .logo-accent {
        font-size: 18px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 10px;
    }

    .account-card {
        padding: 14px;
    }

    .account-title {
        font-size: 16px;
    }

    .account-price {
        font-size: 18px;
    }

    .section-title {
        font-size: 15px;
    }

    .container {
        padding: 12px;
    }

    .profile-balance {
        font-size: 16px;
        margin: 12px 0 16px;
    }

    .btn-primary, .btn-secondary {
        padding: 12px;
        font-size: 13px;
    }
}