/* Modern Crypto Trading Platform Styles */
:root {
    --primary-color: #a67cff;
    --secondary-color: #00e4ff;
    --gradient-start: #5c23ca;
    --gradient-end: #2e0066;
    --sidebar-bg: #0d0522;
    --card-bg: #0f0627;
    --text-primary: #ffffff;
    --text-secondary: #8a8aa0;
    --text-muted: #5f5f70;
    --success-color: #00e396;
    --danger-color: #ff4560;
    --chart-line: #a67cff;
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 20px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.menu-section h3 {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu li {
    display: flex;
    align-items: center;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.menu-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.menu li:hover {
    background-color: rgba(166, 124, 255, 0.1);
    color: var(--primary-color);
}

.menu li.active {
    background-color: rgba(166, 124, 255, 0.15);
    color: var(--primary-color);
    font-weight: 500;
}

.menu li svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

/* Chart Section */
.chart-section {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.crypto-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crypto-icon {
    width: 40px;
    height: 40px;
}

.price-details h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.price-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.price-change.positive {
    color: var(--success-color);
}

.price-change.negative {
    color: var(--danger-color);
}

.time-filters {
    display: flex;
    gap: 8px;
}

.time-filters button {
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-filters button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.time-filters button.active {
    background-color: rgba(166, 124, 255, 0.2);
    color: var(--primary-color);
    font-weight: 500;
}

.chart {
    height: 300px;
    position: relative;
    background: linear-gradient(180deg, rgba(166, 124, 255, 0.1) 0%, rgba(166, 124, 255, 0) 100%);
    border-radius: 12px;
    margin-top: 10px;
}

/* Trade flash animation styles */
.trade-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(166, 124, 255, 0.2);
    z-index: 1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    border-radius: 12px;
}

.trade-notification {
    position: absolute;
    background-color: rgba(46, 213, 115, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: fadeOut 1.5s ease-out forwards;
}

.trade-notification.buy {
    background-color: rgba(46, 213, 115, 0.8);
}

.trade-notification.sell {
    background-color: rgba(255, 71, 87, 0.8);
}

@keyframes fadeOut {
    0% { opacity: 1; transform: scale(0.9); }
    10% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-10px); }
}

.market-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card p {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Trading Section */
.trading-section {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.paper-trading {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.paper-trading:hover {
    background-color: rgba(0, 228, 255, 0.1);
}

.trade-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
}

/* Form Styles */
.trade-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.select-wrapper {
    position: relative;
}

.select-wrapper:after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    border-style: solid;
    border-width: 5px 5px 0 5px;
    border-color: var(--text-secondary) transparent transparent transparent;
    pointer-events: none;
}

select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
}

.input-with-suffix {
    display: flex;
    position: relative;
}

.input-with-suffix input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.input-with-suffix span {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.balance-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5px;
}

.percent-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.percent-selector button {
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.percent-selector button:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.range-slider {
    padding: 10px 0;
}

.range-slider input {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-color) 25%, var(--border-color) 25%);
    outline: none;
}

.range-slider input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(166, 124, 255, 0.5);
}

.trade-info {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-row .value {
    color: var(--text-primary);
    font-weight: 500;
}

.buy-button {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border: none;
    padding: 14px;
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.buy-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(166, 124, 255, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }
    
    .logo h1, .menu li span {
        display: none;
    }
    
    .menu li svg {
        margin-right: 0;
    }
    
    .menu-section h3 {
        text-align: center;
    }
    
    .market-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .time-filters {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .market-stats {
        grid-template-columns: 1fr;
    }
}