/* 기존 구조 유지, 전체적으로 사이즈/위치/폰트/색상만 현대적으로 개선 */

:root {
    --long-color: #26C99B;
    --short-color: #F45F4F;
    --bg-main: #181A1B;
    --bg-card: #23272A;
    --bg-hover: #232C2B;
    --text-main: #F5F6FA;
    --text-sub: #A0A0A0;
    --border-main: #222;
    --accent: #4A90E2;
}

* {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', 'SF Pro Display', 'Noto Sans KR', 'Pretendard', sans-serif !important;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
}

#content {
    padding-bottom: 135px;
}

ul.menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    background-color: var(--bg-card);
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 75px;
    display: flex;
    border-top: 1px solid var(--border-main);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 12;
}

li.menu {
    font-size: 15px;
    flex: 1;
    float: none;
}

li.menu a {
    display: block;
    color: var(--text-main);
    text-align: center;
    padding: 14px 0 12px 0;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: background 0.15s, color 0.15s;
}

li.menu a:hover {
    color: #fff;
    background-color: var(--long-color);
}

.submenu-div {
    padding-bottom: 0;
    overflow: visible;
    background: var(--bg-card);
    position: fixed;
    bottom: 75px;
    width: 100%;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--border-main);
    box-shadow: 0 -1px 8px rgba(0,0,0,0.04);
    z-index: 11;
}

.submenu {
    flex: 1;
    text-align: center;
    padding: 12px 0 10px 0;
    font-size: 15px;
    color: var(--text-main);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-bottom 0.15s;
}

div.submenu-div .active,
.submenu.active {
    border-bottom: 3px solid var(--long-color);
    color: var(--long-color);
    background: var(--bg-hover);
}

.full-width {
    width: 100%;
}

.leverage-active {
    background-color: var(--long-color) !important;
    color: #fff !important;
}

#long {
    color: var(--long-color);
}

#short {
    color: var(--short-color);
}

.up0, .up {
    font-size: 15px;
    color: var(--long-color);
}

.up2 {
    background-color: var(--long-color);
}

.down0, .down {
    font-size: 15px;
    color: var(--short-color);
}

.down2 {
    background-color: var(--short-color);
}

.desc {
    color: var(--text-sub);
    opacity: 0.8;
    font-size: 0.97em;
}

.slidecontainer {
    width: 100%;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 18px;
    border-radius: 6px;
    background: #222;
    outline: none;
    opacity: 1.0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 28px;
    background: #FCD535;
    border-radius: 4px;
}

.market-ranking-title {
    font-size: 28px;
    font-weight: bold;
    margin: 25px 12px 3px 12px;
}

.market-ranking-table {
    width: 98vw;
}

.market-ranking-table td {
    border-bottom: 1px solid #333;
}

.market-ranking-gainer {
    font-size: 3vw;
    font-weight: bold;
    color: var(--long-color);
    text-align: right;
}

.market-ranking-loser {
    font-size: 3vw;
    font-weight: bold;
    color: var(--short-color);
    text-align: right;
}

.market-ranking-box {
    font-size: 2vw;
    position: relative;
    border: 1px solid #333;
    border-radius: 15px;
    padding: 8px;
    width: 22%;
    margin: 20px;
    text-align: center;
    background: var(--bg-card);
    color: var(--text-main);
}

.borderline {
    width: 100%;
    border: 0.1px solid #333;
}

.grid-32, .grid-container, .grid-option {
    display: grid;
    gap: 8px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid var(--border-main);
}
.grid-32 { grid-template-columns: 1fr 1fr 1fr; }
.grid-container { grid-template-columns: 1fr 1fr 1fr; }
.grid-option { grid-template-columns: 1fr 1fr; }

.user-input-textbox, .user-input-textbox-wide, .user-input-textbox-wideper {
    color: var(--long-color);
    background: #212427;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 18px;
    text-align: center;
    padding: 6px 10px;
    margin: 2px 0;
}

.user-input-textbox { width: 90px; height: 32px; }
.user-input-textbox-wide { width: 200px; height: 32px; }
.user-input-textbox-wideper { width: 92%; height: 28px; font-size: 16px; }

#event-text {
    font-size: 22px;
    background: -webkit-linear-gradient(var(--long-color), #006F26);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.me-item {
    padding: 2px 0;
    text-align: left;
    color: var(--text-main);
}

.order-item {
    padding: 2px;
    text-align: right;
}

.coin-listbox, .coin-box {
    font-size: 14px;
    display: inline-block;
    width: 100%;
    padding: 2px 0;
    border-width: 0 0 0px 0;
    border-style: solid;
    margin: 0;
    background-color: transparent;
    color: var(--text-main);
    transition: background 0.15s;
}

.coin-listbox:hover, .coin-box:hover {
    background-color: var(--bg-hover);
}

.trade-history-box {
    font-size: 15px;
    display: inline-block;
    width: 96%;
    padding: 4px;
    border: 1px solid #444;
    margin: 2px;
    background-color: var(--bg-card);
    color: var(--text-main);
    border-radius: 10px;
}

.mine-number-box, .mine-number-box2, .mine-number-box3, .mine-number-box4 {
    display: inline-block;
    border-radius: 6px;
    padding: 7px;
    margin: 5px;
    background-color: #999;
    color: #345;
    font-size: 15px;
    width: 28px;
    text-align: center;
}

.mine-number-box2 { background-color: #FCD535; color: #345; }
.mine-number-box4 { border-radius: 3px; padding: 3px; margin: 2px; }

#order-quantity {
    text-align: right;
    font-size: 16px;
    padding: 3px;
    color: #eee;
}

.interval-button,
.force-button {
    background-color: #222;
    vertical-align: middle;
    border-radius: 5px;
    font-size: 16px;
    height: 40px;
    border: 0px;
    color: var(--text-main);
}

.sort-button {
    background-color: #222;
    vertical-align: middle;
    font-size: 16px;
    width: 33.3%;
    height: 40px;
    border: 0px;
    padding: 0 5px;
    color: var(--text-main);
}

#leverage-label {
    font-size: 20px;
    color: #FCD535;
    background-color: transparent;
}

#leverage-text {
    font-size: 12px;
    display: inline-block;
    border-radius: 2px;
    padding: 2px;
    color: #FCD535;
    border-width: 1px;
    border-style: solid;
    background-color: transparent;
}

.textbox {
    font-size: 18px;
    color: #eee;
    background-color: #111;
    border-width: 0px 0px 2px 0px;
    border-style: solid;
    border-color: #eee;
}

.normal-button, .buy-button, .save-button, .long-button, .sell-button, .short-button, .closeposition-button {
    color: #fff;
    background-color: var(--long-color);
    border: 0px;
    border-radius: 7px;
    font-weight: bold;
    font-size: 17px;
    padding: 12px 0;
    margin: 6px 0;
    width: 92%;
    transition: background 0.15s;
    cursor: pointer;
}
.sell-button, .short-button {
    background-color: var(--short-color);
}
.closeposition-button {
    background: radial-gradient(circle, #222 36%, #444);
    color: #eee;
}
.mini-interval-button {
    color: #fff;
    background-color: transparent;
    border: 0px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    padding: 2px;
    margin: 2px;
    width: 92%;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 15px;
    height: 15px;
    background-color: var(--short-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.num-button,
.num-etc-button,
.b-num-button,
.b-num-etc-button,
.mine-fmn-input-button,
.mine-mc-input-button,
.mine-mc-enter-button,
.mine-fmn2-input-button,
.mine-fmn2-enter-button {
    color: #eee;
    background-color: #222;
    font-size: 22px;
    width: 100%;
    height: 60px;
    border: 0px;
    border-radius: 6px;
    margin: 2px 0;
    transition: background 0.15s;
}

.order-fast-leverage {
    color: #FCD535;
    background-color: #999;
    font-size: 16px;
    width: 95%;
    height: 40px;
    border: 0px;
    margin: 1px 3px;
}

.order-fast-buy {
    color: #eee;
    background-color: var(--long-color);
    border: 0px;
    width: 90%;
    height: 45px;
    margin: 2px 5px;
    font-size: 20px;
}

.order-fast-sell {
    color: #eee;
    background-color: var(--short-color);
    border: 0px;
    width: 90%;
    height: 45px;
    margin: 2px 5px;
    font-size: 20px;
}

.event {
    color: #678;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    padding: 6px 10px;
}

#datagrid {
    border-collapse: collapse;
    margin: 5px 0;
    font-size: 15px;
    width: 100%;
}

#datagrid td,
#datagrid th {
    padding: 10px 0px;
    border-bottom: 1px solid #333;
}

/* Overlay (background) */
.overlay {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    background-color: rgba(0, 0, 0, 0.85);
    overflow-x: hidden;
    transition: 0.15s;
}

.overlay-detail-order {
    height: 0;
    width: 100%;
    position: fixed;
    z-index: 1;
    left: 0;
    bottom: 200;
    background-color: rgba(0, 0, 0, 0.85);
    overflow-x: hidden;
    transition: 0.15s;
}

.overlay-content {
    position: relative;
    top: 5%;
    width: 100%;
    text-align: left;
    margin-top: 20px;
    color: var(--text-main);
}

.overlay div {
    padding: 8px;
    text-decoration: none;
    font-size: 15px;
    color: #818181;
    display: block;
    transition: 0.15s;
}

.overlay div:hover,
.overlay div:focus {
    color: #f1f1f1;
}

.overlay .closebtn,
.overlay-detail-order .closebtn {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 36px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.15s;
}
.overlay .closebtn:hover,
.overlay-detail-order .closebtn:hover {
    color: #fff;
}

.tooltip {
    display: none;
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 1;
    font-size: 13px;
}

.group-box {
    border: 1px solid #ccc;
    border-radius: 7px;
    padding: 12px;
    margin: 12px;
    background: var(--bg-card);
    color: var(--text-main);
}

.group-box legend {
    font-weight: bold;
    padding: 0 5px;
    font-size: 16px;
}

/* 반응형 차트 높이 */
@media screen and (max-height: 450px) {
    .sidenav { padding-top: 5px; }
    .sidenav a { font-size: 18px; }
    .overlay div { font-size: 18px }
    .overlay .closebtn { font-size: 32px; top: 15px; right: 35px; }
}
@media screen and (max-height: 500px) { #chart_div { height: 90px; } }
@media screen and (min-height: 501px) and (max-height: 600px) { #chart_div { height: 190px; } }
@media screen and (min-height: 601px) and (max-height: 700px) { #chart_div { height: 290px; } }
@media screen and (min-height: 701px) and (max-height: 800px) { #chart_div { height: 390px; } }
@media screen and (min-height: 801px) and (max-height: 900px) { #chart_div { height: 490px; } }
@media screen and (min-height: 901px) and (max-height: 1000px) { #chart_div { height: 590px; } }
@media screen and (min-height: 1001px) and (max-height: 1100px) { #chart_div { height: 690px; } }
@media screen and (min-height: 1101px) and (max-height: 1200px) { #chart_div { height: 790px; } }
@media screen and (min-height: 1201px) and (max-height: 1300px) { #chart_div { height: 890px; } }
@media screen and (min-height: 1301px) and (max-height: 1400px) { #chart_div { height: 990px; } }
@media screen and (min-height: 1401px) and (max-height: 1500px) { #chart_div { height: 1090px; } }
@media screen and (min-height: 1501px) and (max-height: 1600px) { #chart_div { height: 1190px; } }
@media screen and (min-height: 1601px) and (max-height: 1700px) { #chart_div { height: 1290px; } }
@media screen and (min-height: 1701px) and (max-height: 1800px) { #chart_div { height: 1390px; } }
@media screen and (min-height: 1801px) and (max-height: 1900px) { #chart_div { height: 1490px; } }
@media screen and (min-height: 1901px) and (max-height: 2000px) { #chart_div { height: 1590px; } }
@media screen and (min-height: 2001px) { #chart_div { height: 1690px; } }

/* ==================== RANKING PAGE STYLES ==================== */

.ranking-container {
    padding: 10px 5px 145px 5px;
    max-width: 360px;
    margin: 0 auto;
}

.ranking-header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
    padding: 25px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-main);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.ranking-header h2 {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-main);
    margin: 0 0 8px 0;
    text-shadow: 0 2px 8px rgba(38,201,155,0.3);
}

.ranking-subtitle {
    color: var(--text-sub);
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

/* Podium Styles */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: end;
    margin: 30px 0 40px 0;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(145deg, rgba(26,201,155,0.05), rgba(244,95,79,0.05));
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.1);
}

.podium-item {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px 15px;
    text-align: center;
    border: 2px solid transparent;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.podium-item.first {
    order: 2;
    transform: scale(1.1);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: 3px solid #FFD700;
    box-shadow: 0 15px 40px rgba(255,215,0,0.4);
}

.podium-item.second {
    order: 1;
    transform: scale(1.05);
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #000;
    border: 2px solid #C0C0C0;
}

.podium-item.third {
    order: 3;
    transform: scale(1.05);
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    color: #fff;
    border: 2px solid #CD7F32;
}

.podium-item.my-rank {
    border-color: var(--long-color) !important;
    box-shadow: 0 0 20px rgba(38,201,155,0.5) !important;
}

.podium-crown {
    font-size: 30px;
    margin-bottom: 10px;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.podium-badge img {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.podium-info {
    margin-top: 15px;
}

.podium-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.podium-name.champion {
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.podium-amount {
    font-size: 14px;
    font-weight: 600;
}

.podium-amount.champion {
    font-size: 16px;
    font-weight: bold;
}

.crystal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.crystal-badge.gold {
    background: rgba(255,215,0,0.3);
    color: #000;
}

/* Ranking List */
.ranking-list {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border-main);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.ranking-list-header {
    margin-bottom: 20px;
    text-align: center;
}

.ranking-list-header h3 {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-main);
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 5px 0;
}

.ranking-item:hover {
    background: var(--bg-hover);
    transform: translateX(5px);
}

.ranking-item.my-position {
    background: linear-gradient(90deg, rgba(38,201,155,0.1), transparent);
    border: 1px solid rgba(38,201,155,0.3);
    box-shadow: 0 4px 15px rgba(38,201,155,0.2);
}

.ranking-item.top-three {
    background: linear-gradient(90deg, rgba(255,215,0,0.1), transparent);
    border-left: 4px solid #FFD700;
}

.ranking-item.top-ten {
    font-weight: 600;
}

.rank-number {
    width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rank-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-sub);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border-radius: 50%;
}

.player-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 15px;
}

.player-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.crystal-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--long-color), #1e9b7a);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.crystal-count {
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-badge {
    background: var(--long-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(38,201,155,0.3);
}

.player-assets {
    text-align: right;
    padding-right: 10px;
}

.asset-amount {
    font-size: 16px;
    font-weight: bold;
}

.asset-amount.positive {
    color: var(--long-color);
}

.asset-amount.negative {
    color: var(--short-color);
}

/* ==================== MY PAGE STYLES ==================== */

.account-container {
    padding: 20px 15px 145px 15px;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Logout Button */
.logout-button {
    position: absolute;
    top: 20px;
    right: 15px;
    background: linear-gradient(135deg, var(--short-color), #d44838);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244,95,79,0.3);
}

.logout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244,95,79,0.4);
}

/* User Header */
.user-header {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
    border-radius: 25px;
    padding: 25px 20px;
    margin: 50px 0 30px 0;
    border: 1px solid var(--border-main);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
}

.user-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--long-color), var(--short-color), var(--long-color));
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.user-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-nickname {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-main);
    text-shadow: 0 2px 8px rgba(38,201,155,0.3);
}

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

.crystal-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--long-color), #1e9b7a);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(38,201,155,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.crystal-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38,201,155,0.4);
}

.crystal-count {
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Assets Grid */
.assets-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.asset-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-main);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.asset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.asset-card-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.asset-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-main));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.asset-info {
    flex: 1;
}

.asset-label {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 5px;
    font-weight: 500;
}

.asset-value {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.asset-value.positive {
    color: var(--long-color);
}

.asset-value.negative {
    color: var(--short-color);
}

.asset-actions {
    display: flex;
    gap: 10px;
}

/* Premium Buttons */
.premium-button {
    padding: 10px 20px;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    position: relative;
    overflow: hidden;
}

.premium-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.premium-button:hover::before {
    left: 100%;
}

.premium-button.primary {
    background: linear-gradient(135deg, var(--long-color), #1e9b7a);
    color: white;
    box-shadow: 0 4px 15px rgba(38,201,155,0.3);
}

.premium-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38,201,155,0.4);
}

.premium-button.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76,175,80,0.3);
}

.premium-button.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76,175,80,0.4);
}

/* Positions Section */
.positions-section {
    margin-top: 30px;
}

.section-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--long-color), var(--short-color));
    border-radius: 2px;
}

/* Position Cards */
.position-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--border-main);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.position-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

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

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

.coin-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-main);
}

.coin-symbol {
    font-size: 14px;
    color: var(--text-sub);
    opacity: 0.8;
}

.leverage-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.leverage-badge.long {
    background: linear-gradient(135deg, var(--long-color), #1e9b7a);
    color: white;
    box-shadow: 0 2px 8px rgba(38,201,155,0.3);
}

.leverage-badge.short {
    background: linear-gradient(135deg, var(--short-color), #d44838);
    color: white;
    box-shadow: 0 2px 8px rgba(244,95,79,0.3);
}

.position-pnl {
    text-align: right;
}

.pnl-amount {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 2px;
}

.pnl-percentage {
    font-size: 14px;
    font-weight: 600;
}

.pnl-amount.profit, .pnl-percentage.profit {
    color: var(--long-color);
}

.pnl-amount.loss, .pnl-percentage.loss {
    color: var(--short-color);
}

/* Position Details */
.position-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.detail-label {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 600;
}

/* Exchange Overlay */
.exchange-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.exchange-modal {
    background: var(--bg-card);
    border-radius: 25px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border-main);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.exchange-header h3 {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-main);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-sub);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--short-color);
    color: white;
}

.exchange-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 25px 0;
    padding: 20px;
    background: var(--bg-hover);
    border-radius: 15px;
    border: 1px solid var(--border-main);
}

.exchange-item {
    text-align: center;
    flex: 1;
}

.exchange-icon {
    margin-bottom: 8px;
}

.exchange-amount {
    font-size: 18px;
    font-weight: bold;
    color: var(--long-color);
}

.exchange-arrow {
    font-size: 24px;
    color: var(--text-sub);
    margin: 0 15px;
}

/* Numpad */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.numpad-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-main);
    border-radius: 15px;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.numpad-btn:hover {
    background: var(--long-color);
    color: white;
    transform: scale(1.05);
}

.numpad-btn.special {
    background: linear-gradient(135deg, var(--long-color), #1e9b7a);
    color: white;
}

.numpad-btn.delete {
    background: linear-gradient(135deg, var(--short-color), #d44838);
    color: white;
}

.exchange-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.exchange-cancel-btn, .exchange-confirm-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exchange-cancel-btn {
    background: var(--bg-hover);
    color: var(--text-main);
    border: 1px solid var(--border-main);
}

.exchange-cancel-btn:hover {
    background: var(--short-color);
    color: white;
}

.exchange-confirm-btn {
    background: linear-gradient(135deg, var(--long-color), #1e9b7a);
    color: white;
    box-shadow: 0 4px 15px rgba(38,201,155,0.3);
}

.exchange-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38,201,155,0.4);
}

/* ==================== MARKET/EXCHANGE PAGE STYLES ==================== */

/* Market Container */
.market-container {
    padding: 15px;
    max-width: 100%;
    margin: 0 auto;
}

/* Sort Header */
.sort-header {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-main);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.sort-header table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.sort-button {
    background: transparent;
    color: var(--text-main);
    border: none;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.3px;
}

.sort-button:hover {
    background: var(--bg-hover);
    color: var(--long-color);
    transform: translateY(-1px);
}

.sort-button.active {
    background: linear-gradient(135deg, var(--long-color), #1e9b7a);
    color: white;
    box-shadow: 0 4px 15px rgba(38,201,155,0.3);
}

/* Modern Coin List Styles */
.coin-listbox {
    background: var(--bg-card);
    border-radius: 8px;
    margin: 2px 0;
    padding: 0;
    border: 1px solid var(--border-main);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    position: relative;
}

.coin-listbox:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: rgba(38,201,155,0.3);
}

.coin-listbox:active {
    transform: translateY(0px);
    transition: transform 0.1s;
}

/* Coin List Table Layout */
.coin-listbox table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.coin-listbox td {
    padding: 6px 8px;
    vertical-align: middle;
}

/* Price Indicator Strip */
.price-indicator {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    margin-right: 8px;
}

.price-indicator.up {
    background: linear-gradient(to bottom, var(--long-color), rgba(38,201,155,0.3));
}

.price-indicator.down {
    background: linear-gradient(to bottom, var(--short-color), rgba(244,95,79,0.3));
}

/* Holdings Indicator */
.holdings-indicator {
    width: 2px;
    background: linear-gradient(to bottom, #FFD700, #FFA500);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255,215,0,0.5);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Coin Information */
.coin-main-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 1px 0;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.coin-symbol {
    font-size: 10px;
    color: var(--text-sub);
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* Coin Type Badges */
.coin-type-etf {
    color: #0B94F6;
    text-shadow: 0 0 8px rgba(11,148,246,0.3);
}

.coin-type-long {
    color: var(--long-color);
    text-shadow: 0 0 8px rgba(38,201,155,0.3);
}

.coin-type-short {
    color: var(--short-color);
    text-shadow: 0 0 8px rgba(244,95,79,0.3);
}

/* Price Display */
.coin-price {
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.coin-price.up {
    color: var(--long-color);
}

.coin-price.down {
    color: var(--short-color);
}

/* Change Percentage */
.coin-change {
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 50px;
    display: inline-block;
    line-height: 1.2;
}

.coin-change.up {
    background: linear-gradient(135deg, rgba(38,201,155,0.15), rgba(38,201,155,0.05));
    color: var(--long-color);
    border: 1px solid rgba(38,201,155,0.2);
}

.coin-change.down {
    background: linear-gradient(135deg, rgba(244,95,79,0.15), rgba(244,95,79,0.05));
    color: var(--short-color);
    border: 1px solid rgba(244,95,79,0.2);
}

/* Price Difference */
.coin-diff {
    text-align: right;
    font-size: 10px;
    font-weight: 600;
    opacity: 0.8;
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* Box View Styles */
.coin-box {
    background: var(--bg-card);
    border-radius: 12px;
    margin: 4px;
    padding: 12px;
    border: 1px solid var(--border-main);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.coin-box:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: rgba(38,201,155,0.4);
}

.coin-box:active {
    transform: translateY(-1px) scale(1.0);
}

.coin-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--long-color), var(--short-color), var(--long-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.coin-box:hover::before {
    opacity: 0.6;
}

.coin-box table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.coin-box td {
    padding: 2px 4px;
    vertical-align: middle;
}

/* Box View Coin Name */
.coin-box-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.coin-box-symbol {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Box View Change */
.coin-box-change {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
}

/* Market Rankings */
.market-ranking-title {
    font-size: 20px;
    font-weight: 800;
    margin: 20px 15px 15px 15px;
    text-align: center;
    background: linear-gradient(135deg, var(--long-color), var(--short-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.market-ranking-table {
    width: 100%;
    margin-bottom: 20px;
}

.market-ranking-box {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    padding: 8px 6px;
    width: 48%;
    margin: 2px 1%;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.market-ranking-box:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: rgba(38,201,155,0.5);
    z-index: 10;
}

.market-ranking-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--long-color), #FFD700, var(--short-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.market-ranking-box:hover::before {
    opacity: 1;
}

.market-ranking-gainer, .market-ranking-loser {
    font-size: 13px;
    font-weight: 800;
    margin-top: 4px;
    text-shadow: 0 1px 4px currentColor;
    font-variant-numeric: tabular-nums;
}

.market-ranking-gainer {
    color: var(--long-color);
}

.market-ranking-loser {
    color: var(--short-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .coin-listbox {
        margin: 1px 0;
        border-radius: 6px;
    }
    
    .coin-listbox td {
        padding: 4px 6px;
    }
    
    .coin-name {
        font-size: 12px;
    }
    
    .coin-symbol {
        font-size: 9px;
    }
    
    .coin-price {
        font-size: 12px;
    }
    
    .coin-change {
        font-size: 10px;
        padding: 2px 4px;
        min-width: 40px;
    }
    
    .coin-diff {
        font-size: 9px;
    }
    
    .coin-box {
        margin: 2px;
        padding: 6px;
        border-radius: 8px;
    }
    
    .coin-box-name {
        font-size: 12px;
    }
    
    .coin-box-change {
        font-size: 12px;
        padding: 2px 4px;
    }
    
    .market-ranking-box {
        width: 46%;
        margin: 2px 2%;
        padding: 6px 4px;
        border-radius: 10px;
    }
    
    .market-ranking-gainer, .market-ranking-loser {
        font-size: 12px;
        margin-top: 3px;
    }
    
    .market-ranking-title {
        font-size: 16px;
        margin: 10px 5px 8px 5px;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.coin-loading {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}