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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0a1f 100%);
    color: #e6e6e6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 600;
    color: #7e6bff;
}

.logo svg {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a, .nav-link {
    color: #e6e6e6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.3s, color 0.3s;
    cursor: pointer;
}

.nav a:hover, .nav a.active, .nav-link:hover, .nav-link.active {
    opacity: 1;
    color: #7e6bff;
}

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

.profile-dropdown {
    position: relative;
}

.profile-btn {
    background: transparent;
    border: none;
    color: #e6e6e6;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-btn::after {
    content: '▼';
    font-size: 10px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #2e1a47;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 150px;
    z-index: 100;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #e6e6e6;
    text-decoration: none;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background: rgba(126, 107, 255, 0.2);
}

.login-btn, .register-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.login-btn {
    background: transparent;
    color: #e6e6e6;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.register-btn {
    background: #7e6bff;
    color: #fff;
}

.login-btn:hover, .register-btn:hover {
    opacity: 0.9;
}

.main-content {
    display: none;
    padding: 40px;
    flex: 1;
}

.main-content.active {
    display: block;
}

.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px 40px;
    background: url('https://via.placeholder.com/1200x400/1a1a2e/ffffff?text=Market+Background') no-repeat center center;
    background-size: cover;
    min-height: 400px;
}

.hero-text h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 16px;
    opacity: 0.7;
    max-width: 450px;
}

.promotions {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 0;
}

.promo-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.promo-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.promo-card p {
    font-size: 14px;
    opacity: 0.7;
}

.promo-card .btn-primary {
    background: #7e6bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: all 0.3s;
}

.promo-card .btn-primary:hover {
    background: #5a4bff;
}

.news-section {
    margin-top: 40px;
}

.news-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.news-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

.news-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.news-content p {
    font-size: 14px;
    opacity: 0.7;
}

.news-content .source {
    font-size: 14px;
    color: #7e6bff;
    margin-top: 5px;
}

.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.portfolio-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
}

.portfolio-amount {
    font-size: 24px;
    font-weight: 600;
    margin: 10px 0;
}

.portfolio-value {
    font-size: 18px;
    color: #7e6bff;
}

.crypto-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 10px;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wallet-section {
    text-align: left;
}

.wallet-section h2 {
    margin-bottom: 20px;
    color: #7e6bff;
    font-size: 28px;
}

.balance {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #43e97b;
}

.deposit-form {
    margin-top: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-group select, .input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #e6e6e6;
    font-size: 14px;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.crypto-address {
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(45deg, #7e6bff 0%, #5a4bff 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(126, 107, 255, 0.3);
}

.trading-section {
    display: grid;
    grid-template-columns: 3fr 6fr 3fr;
    gap: 20px;
    margin-bottom: 40px;
}

.crypto-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

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

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

.crypto-list::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #7e6bff, #5a4bff);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.crypto-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a4bff, #7e6bff);
}

.no-auth-message {
    color: #f5576c;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.price.zero {
    color: #9ca3af;
    font-style: italic;
}

.crypto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.crypto-item:hover, .crypto-item.selected {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

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

.crypto-price {
    text-align: right;
}

.price {
    font-size: 18px;
    font-weight: 600;
}

.change {
    font-size: 14px;
}

.change.positive {
    color: #43e97b;
}

.change.negative {
    color: #f5576c;
}

.order-book {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.order-book-table {
    width: 100%;
    border-collapse: collapse;
}

.order-book-table th, .order-book-table td {
    padding: 8px;
    text-align: right;
    font-size: 14px;
}

.order-book-table .buy {
    color: #43e97b;
}

.order-book-table .sell {
    color: #f5576c;
}

.trading-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    flex-grow: 1;
    height: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeframe-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.timeframe-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #e6e6e6;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.timeframe-btn.active {
    background: #7e6bff;
    border-color: #7e6bff;
}

.timeframe-btn:hover {
    background: rgba(126, 107, 255, 0.3);
}

.buy-sell-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

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

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s;
}

.tab.active {
    background: linear-gradient(45deg, #7e6bff 0%, #5a4bff 100%);
}

.trade-stats-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.stats-label {
    color: #9ca3af;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.transactions-table th, .transactions-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.transactions-table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.status.success {
    background: rgba(67, 233, 123, 0.2);
    color: #43e97b;
}

.support-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #7e6bff, #5a4bff);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.support-button:hover {
    transform: scale(1.1);
}

.support-chat {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.support-chat.active {
    display: flex;
}

.chat-header {
    background: rgba(126, 107, 255, 0.2);
    padding: 10px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 16px;
    color: #7e6bff;
}

.chat-close {
    background: none;
    border: none;
    color: #e6e6e6;
    font-size: 16px;
    cursor: pointer;
}

.chat-body {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    max-width: 80%;
}

.chat-message.user {
    background: #7e6bff;
    color: #fff;
    margin-left: auto;
}

.chat-message.support {
    background: rgba(255, 255, 255, 0.1);
    color: #e6e6e6;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #e6e6e6;
    font-size: 14px;
    margin-right: 5px;
}

.chat-input button {
    background: #7e6bff;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

.chat-input button:hover {
    background: #5a4bff;
}

.custom-footer {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    text-align: left;
}

.footer-section h3 {
    font-size: 16px;
    color: #7e6bff;
    margin-bottom: 15px;
}

.footer-section a {
    display: block;
    color: #e6e6e6;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.footer-section a:hover {
    opacity: 1;
    color: #7e6bff;
}

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.trade-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.trade-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pair-symbol {
    font-size: 18px;
    font-weight: 600;
}

.current-price {
    font-size: 24px;
    font-weight: 700;
    color: #43e97b;
}

.price-change {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-change.positive {
    color: #43e97b;
}

.price-change.negative {
    color: #f5576c;
}

.p2p-btn {
    background: #2563eb;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #fff;
}

.p2p-btn:hover {
    background: #1d4ed8;
}

.settings-icon {
    cursor: pointer;
    width: 24px;
    height: 24px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 16px;
}

.search-input {
    background: transparent;
    border: none;
    color: #e6e6e6;
    font-size: 14px;
    width: 100%;
}

.search-input:focus {
    outline: none;
}

.search-icon {
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.trade-history {
    margin-top: 24px;
}

.trade-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.trade-history-item .time {
    color: #9ca3af;
}

.trade-history-item .price.buy {
    color: #43e97b;
}

.trade-history-item .price.sell {
    color: #f5576c;
}

.positions-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.no-positions {
    color: #9ca3af;
    font-size: 14px;
    padding: 16px 0;
}

.favorite-icon {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    cursor: pointer;
}

.favorite-icon.active {
    color: #f59e0b;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: #e6e6e6;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #7e6bff;
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #7e6bff;
}

.modal-content .input-group {
    margin-bottom: 15px;
}

.modal-content .input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #e6e6e6;
    font-size: 14px;
}

.modal-content .input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.modal-content .btn-primary {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    font-size: 14px;
}

#register-error, #login-error {
    color: #f5576c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    display: none;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    .trading-section {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        gap: 20px;
    }
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero-section {
        flex-direction: column;
        text-align: center;
    }
    .hero-text h2 {
        font-size: 36px;
    }
    .promotions {
        flex-direction: column;
        align-items: center;
    }
    .promo-card {
        width: 100%;
        max-width: 300px;
    }
    .support-chat {
        width: 90%;
        right: 5%;
    }
    .chart-container {
        height: 300px;
    }
    .custom-footer {
        flex-direction: column;
        padding: 20px;
    }
    .footer-section {
        margin-bottom: 20px;
    }
    .modal-content {
        max-width: 90%;
        padding: 15px;
    }
}
