/* Premium Trade List Styles to match the provided image */

:root {
    --premium-blue: #159EFD;
    --premium-bg: #F0F4FF;
    --premium-border: #E3E3E3;
    --premium-text: #2E2E2E;
    --premium-gray: #767676;
    --premium-red: #D62222;
    --premium-purple: #B0A1F7;
}

.list_top_wrap {
    width: max(100vw, 1080px);
    max-width: none;
    min-width: 1080px;
    margin-left: calc(50% - max(50vw, 540px));
    margin-right: calc(50% - max(50vw, 540px));
    box-sizing: border-box;
    background-color: var(--premium-bg);
    padding: 0;
    margin-bottom: 20px;
}

.list_top_ticker_bleed {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 30px;
    box-sizing: border-box;
    background: linear-gradient(90deg, #2299ff 0%, #66ccff 50%, #ccaaff 100%);
    box-shadow: 0 2px 10px rgba(34, 153, 255, 0.2);
}

.list_top_ticker_bleed > .content_center {
    padding: 0 20px;
    border: none;
    border-radius: 0;
    background: transparent;
}

.list_top_ticker_bleed .premium_ticker_wrap {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.premium_ticker_wrap {
    display: flex;
    align-items: center;
    height: 54px;
    background: linear-gradient(90deg, #2299FF 0%, #66CCFF 50%, #CCAAFF 100%);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    color: #fff;
}

.ticker_label {
    padding: 0 30px;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker_content {
    flex: 1;
    min-width: 0;
    padding: 0 20px;
    height: 100%;
}

.ticker_content .swiper {
    height: 100%;
    width: 100%;
    min-width: 0;
}

.ticker_content .swiper-slide {
    width: 100%;
    box-sizing: border-box;
}

.ticker_content .slide_item,
.ticker_content .ticker_slide_item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 54px;
    gap: 12px;
    font-size: 15px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 4px 0 0;
}

.ticker_content .ticker_slide_item .ticker_part {
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker_content .ticker_slide_item .ticker_game {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
    min-width: 0;
}

.ticker_content .ticker_slide_item .ticker_part:not(:last-child)::after {
    content: '|';
    margin-left: 16px;
    opacity: 0.8;
}

.ticker_content .ticker_amount {
    font-weight: 700;
}

.ticker_content .subject {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticker_content .price {
    font-weight: 700;
}

.premium_ticker_wrap .ticker_label,
.premium_ticker_wrap .slide_item,
.premium_ticker_wrap .ticker_price {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.ticker_price {
    background: transparent;
    border: none;
    box-shadow: none;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px 0 20px;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Game Info Section */
.premium_game_info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 25px;
}

.game_title_box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.game_icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.game_name {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    color: #2e2e2e;
}

.game_name .server_name {
    font-size: 18px;
    font-weight: 400;
    color: #666;
    margin-left: 10px;
}

.trade_type_toggle {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    height: 40px;
    box-sizing: border-box;
    background: #fff;
    padding: 4px;
    border-radius: 25px;
    border: none;
    border-image: none;
}

.trade_type_toggle a {
    padding: 5px 18px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    color: var(--premium-text);
    transition: all 0.2s;
}

.trade_type_toggle a.trade_type_sell.active {
    background: rgba(22, 158, 253, 1);
    color: #fff;
}

.trade_type_toggle a.trade_type_buy.active {
    background: rgba(34, 159, 30, 1);
    color: #fff;
}

/* Filter Box */
.premium_filter_box {
    background: #fff;
    border: 1px solid var(--premium-border);
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category_tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.category_tabs a {
    flex: 1;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #444;
}

.category_tabs a.active {
    background: var(--premium-blue);
    border-color: var(--premium-blue);
    color: #fff;
}

/* 서버 선택: 헤더 + 접기/펼치기 */
.server_tags_section {
    margin-top: 4px;
}

.server_tags_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.server_tags_title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--premium-text);
}

.server_tags_title_dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff8c42;
    flex-shrink: 0;
}

.server_tags_toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    flex-shrink: 0;
}

.server_tags_toggle:hover {
    color: var(--premium-blue);
}

.server_tags_chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.server_tags_section.is-expanded .server_tags_chevron {
    transform: rotate(180deg);
}

.server_tags_scroll {
    overflow: hidden;
    /* max-height는 JS가 실제 scrollHeight(px)로 맞춰 애니메이션 (고정 3000→44 전환 시 끊김 방지) */
    transition: max-height 0.45s cubic-bezier(0.33, 1, 0.32, 1);
}

@media (prefers-reduced-motion: reduce) {
    .server_tags_scroll {
        transition-duration: 0.01ms;
    }
}

/* 접힘: 태그 1줄만 (두 번째 줄·아래 여백 숨김) */
.server_tags_section:not(.is-expanded) .server_tags_scroll {
    max-height: 44px;
}

/* 펼침: max-height 미지정 → 콘텐츠 전체. 애니메이션은 JS가 px로 제어 */

.server_tags_section:not(.is-expanded) .server_tags {
    padding-bottom: 0;
}

.server_tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 10px;
    padding: 0 0 20px;
}

.server_tags a {
    padding: 8px 14px;
    border: 1px solid var(--premium-border);
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    background: #fff;
    min-width: 60px;
    text-align: center;
}

.server_tags a.active {
    border-color: var(--premium-blue);
    color: var(--premium-blue);
    font-weight: 600;
}

/* Expanded Filter Body */
.filter_expand_body {
    display: none;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.filter_expand_body.show {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter_row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter_row .row_label_btn {
    padding: 8px 20px;
    border: 1px solid #C6D9FF;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--premium-blue);
    background: #fff;
    min-width: 120px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.filter_row .row_choices {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter_row .row_choices button,
.filter_row .row_choices a {
    padding: 8px 16px;
    border: 1px solid var(--premium-border);
    border-radius: 8px;
    font-size: 14px;
    color: #444;
    background: #fff;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.filter_row .row_label_btn.active,
.filter_row .row_choices a.active,
.filter_row .row_choices button.active {
    border-color: var(--premium-blue);
    color: var(--premium-blue);
    font-weight: 600;
}

.filter_footer {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 48px;
}

.expand_filter {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #2e2e2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.expand_filter::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%232E2E2E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat center;
    transition: transform 0.2s;
}

.expand_filter.on::after {
    transform: rotate(180deg);
}

.reset_filter {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* List Header Info */
.premium_list_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 20px;
}

.list_summary_count {
    font-size: 17px;
    font-weight: 500;
}

.list_summary_count .count {
    color: var(--premium-red);
    font-weight: 700;
}

.list_search_bar {
    display: flex;
    align-items: center;
    background: #F0F0F0;
    border-radius: 20px;
    padding: 4px 15px;
    width: 320px;
}

.list_search_bar input {
    background: none;
    border: none;
    padding: 8px;
    flex: 1;
    outline: none;
    font-size: 14px;
}

.list_search_bar .search_icon {
    width: 18px;
    height: 18px;
    opacity: 0.5;
}

/* Item List Section */
.premium_section_title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.premium_section + .premium_section {
    margin-top: 34px;
}

.premium_item_list {
    background: #fff;
    border: 1px solid #C6D9FF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.premium_item_row {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f2f5ff;
    gap: 24px;
    transition: background 0.2s;
    text-decoration: none;
}

.premium_item_row:hover,
.premium_item_row:focus,
.premium_item_row:active {
    background: #f8fbff;
    text-decoration: none;
}

.premium_item_row:hover .item_server,
.premium_item_row:hover .item_title,
.premium_item_row:hover .item_quantity,
.premium_item_row:hover .item_price,
.premium_item_row:hover .item_price_main,
.premium_item_row:hover .item_price_sub,
.premium_item_row:hover .item_meta_line,
.premium_item_row:hover .item_time {
    text-decoration: none;
}

.premium_item_row:last-child {
    border-bottom: none;
}

.item_icon {
    width: 40px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item_icon .credit_mark_new {
    width: 40px;
    height: 42px;
}

.item_icon .game_logo_img {
    width: 40px;
    height: 42px;
    object-fit: contain;
}

.item_main_info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item_server {
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
}

.item_title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    width: 60%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: normal;
    overflow-wrap: normal;
}

.item_title em {
    color: var(--premium-blue);
    font-style: normal;
}

/* 제목 열과 금액 열 사이: 수량 가로·세로 중앙 */
.item_quantity_col {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-width: 120px;
    max-width: 200px;
    padding: 0 12px;
    box-sizing: border-box;
    text-align: center;
}

.item_price_col {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 140px;
}

.item_quantity {
    font-size: 14px;
    color: #777;
    white-space: nowrap;
}

.item_price {
    font-size: 20px;
    font-weight: 800;
    color: var(--premium-blue);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 140px;
}

.item_price_main {
    font-size: 20px;
    font-weight: 800;
    color: var(--premium-blue);
    line-height: 1.1;
}

.premium_section--regular .item_price,
.premium_section--regular .item_price_main {
    color: #333;
}

.item_price_sub {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    line-height: 1.2;
}

.item_meta_line {
    display: inline-block;
    line-height: 1.2;
}

.item_price small {
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-right: 4px;
}

.item_time {
    width: 70px;
    text-align: right;
    font-size: 14px;
    color: #999;
}

/* 거래종료(완료/취소) 행: itemmania 거래종료 리스트와 동일한 톤 */
.premium_item_row.is-closed {
    background: #fafafa;
}

.premium_item_row.is-closed:hover {
    background: #f3f3f3;
}

.premium_item_row.is-closed .item_icon .credit_mark_new,
.premium_item_row.is-closed .item_icon .game_logo_img {
    filter: grayscale(1);
    opacity: 0.55;
}

.premium_item_row.is-closed .item_server,
.premium_item_row.is-closed .item_title,
.premium_item_row.is-closed .item_quantity,
.premium_item_row.is-closed .item_price,
.premium_item_row.is-closed .item_price_main,
.premium_item_row.is-closed .item_price_sub,
.premium_item_row.is-closed .item_meta_line {
    color: #b5b5b5 !important;
}

.premium_item_row.is-closed .item_title em {
    color: #b5b5b5 !important;
}

.item_time--closed {
    width: auto;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.item_closed_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(93, 104, 124, 1);
    color: rgba(255, 255, 255, 1);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.item_time--inprogress {
    width: auto;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.item_inprogress_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(34, 139, 230, 1);
    color: rgba(255, 255, 255, 1);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

/* Header modifications for overall look */
.header-main {
    border-bottom: none !important;
    box-shadow: none !important;
}

.header-inner {
    height: 100px !important;
}

.header-nav {
    gap: 30px !important;
}

/* 로그인/회원가입: 헤더 액션은 텍스트 링크 (itemmania와 동일) */
.g_header .header-actions .header-login,
.g_header .header-actions .header-signup {
    background: transparent !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    color: var(--color-font, #333) !important;
}

/* Base Search Bar matching image */
.header-search {
    padding: 10px 0 30px !important;
}

/* 검색창 본문 스타일은 itemmania.css (알약형·플렉스)와 동기화 */
.g_search_wrapper .search_area {
    border: 4px solid var(--color-blue7);
    border-radius: 28px;
    min-height: 54px;
    height: auto;
    padding-left: 8px;
}

.g_search_wrapper .search_area.focus_on {
    border-bottom-color: transparent;
    border-radius: 28px 28px 0 0;
}

.g_search_wrapper .g_trade_type {
    width: 120px !important;
}

.g_search_wrapper .trade_type_btn {
    font-size: 16px !important;
}

/* 목록 페이지: 상품등록 CTA (연한 배경·파란 테두리·원형 +) */
.trade-btn .trade-btn-blue {
    min-height: 51px !important;
    height: 51px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    line-height: 1 !important;
    padding: 0 24px !important;
    border-radius: 14px !important;
    border: 2px solid #79a9ef !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    background: #c9defb !important;
    color: #1f79e8 !important;
}

.trade-btn .trade-btn-blue:hover {
    background: #bed7fb !important;
    border-color: #5f98ea !important;
    color: #166fe0 !important;
}

.trade-btn .trade-btn-blue .hero-cta-plus {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    color: var(--color-white) !important;
    border-radius: 50% !important;
    background: #2f81ed !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    font-family: Arial, sans-serif !important;
    overflow: hidden !important;
    transform: none !important;
}

.trade-btn .trade-btn-blue:hover .hero-cta-plus {
    background: #226fe2 !important;
}

.trade-btn .trade-btn-blue .hero-cta-text {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: inherit !important;
    transform: translateY(1.5px) !important;
}

/* Footer note */
.footer-note-line {
    background: #E3E3E3 !important;
}

/* Logo Styling */
.header-logo .logo-text {
    display: inline-flex !important;
    font-size: 28px !important;
    font-weight: 900 !important;
    letter-spacing: -1px;
}

.header-logo .logo-text::first-letter {
    color: #00B45F;
    /* Green for '1' */
}

.logo-img {
    height: 48px !important;
    object-fit: contain;
}