/* Tech-style CSS for cryptocurrency portfolio */

/* Navigation Menu Styles */
.nav-menu {
    background-color: rgba(10, 14, 39, 0.95);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding: 10px 0;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-menu .layui-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-brand {
    font-size: 20px;
    font-weight: bold;
    color: #00ffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(0, 255, 255, 0.7);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    color: #00ffff;
    background-color: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.nav-link.active {
    color: #00ffff;
    background-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
    font-weight: bold;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Authentication buttons */
.auth-button {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.login-button {
    color: #00ffff;
    border-color: rgba(0, 255, 255, 0.5);
    background-color: transparent;
}

.login-button:hover {
    background-color: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.admin-button {
    color: #8a2be2;
    border-color: rgba(138, 43, 226, 0.5);
    background-color: transparent;
}

.admin-button:hover {
    background-color: rgba(138, 43, 226, 0.1);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

/* Base styles */
body {
    background-color: #0a0e27;
    color: #00ffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-image: radial-gradient(circle at 10% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(138, 43, 226, 0.1) 0%, transparent 20%);
    min-height: 100vh;
}

/* Table styles - use more specific selectors to avoid conflict with layui-table */
.layui-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(10, 14, 39, 0.8) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
    overflow: hidden;
    border-radius: 8px;
}

.layui-table, 
.layui-table th, 
.layui-table td {
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
}

.layui-table th, 
.layui-table td {
    padding: 12px !important;
    text-align: center !important;
    white-space: nowrap !important; /* 禁止换行 */
    border-bottom: 1px solid rgba(0, 255, 255, 0.2) !important;
    transition: all 0.3s ease !important;
    background-color: transparent !important;
    color: #00ffff !important;
}

.layui-table th,
.layui-table thead tr,
.layui-table thead {
    background-color: rgba(0, 255, 255, 0.1) !important;
    background-image: none !important;
    background: rgba(0, 255, 255, 0.1) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-size: 14px !important;
    color: #00ffff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
    box-shadow: none !important;
    border-collapse: collapse !important;
}

.layui-table tbody tr {
    transition: all 0.3s ease !important;
    background-color: transparent !important;
}

.layui-table tbody tr:hover {
    background-color: rgba(0, 255, 255, 0.05) !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2) !important;
    transform: translateY(-1px) !important;
}

/* Footer styles */
.layui-table tfoot {
    background-color: rgba(138, 43, 226, 0.15) !important;
    font-weight: bold !important;
    border-top: 2px solid #8a2be2 !important;
}

/* Profit/loss styles */
.profit-positive,
.layui-table td.profit-positive {
    color: #00ff88 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5) !important;
    background-color: transparent !important;
}

.profit-negative,
.layui-table td.profit-negative {
    color: #ff4444 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5) !important;
    background-color: transparent !important;
}

/* Price change indicators */
.price-up,
.layui-table td.price-up {
    color: #00ff88 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5) !important;
}

.price-down,
.layui-table td.price-down {
    color: #ff4444 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5) !important;
}

/* Header styles */
h1 {
    color: #8a2be2;
    text-align: center;
    margin: 20px 0;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.7);
    font-size: 2.5rem;
    letter-spacing: 2px;
}

/* Button styles - use specific selector for layui buttons */
.layui-btn {
    background: linear-gradient(135deg, #00ffff, #8a2be2) !important;
    color: #0a0e27 !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3) !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.layui-btn:hover {
    background: linear-gradient(135deg, #8a2be2, #00ffff) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6) !important;
    transform: translateY(-2px) !important;
}

.layui-btn:active {
    transform: translateY(0) !important;
}

/* Input styles - use specific selector for layui inputs */
.layui-input {
    background-color: rgba(10, 14, 39, 0.8) !important;
    border: 1px solid rgba(0, 255, 255, 0.3) !important;
    color: #00ffff !important;
    padding: 10px !important;
    border-radius: 5px !important;
    transition: all 0.3s ease !important;
    font-size: 14px !important;
}

.layui-input:focus {
    outline: none !important;
    border-color: #8a2be2 !important;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5) !important;
}

/* Container styles */
.layui-container {
    max-width: 1200px;
    margin: 0 auto !important;
    padding: 0 20px !important;
    width: 100% !important;
}

/* Layui form styles override */
.layui-form {
    background-color: rgba(10, 14, 39, 0.8) !important;
    padding: 20px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1) !important;
    width: 100% !important;
    color: #00ffff !important;
}

.layui-form-item {
    margin-bottom: 20px !important;
}

.layui-inline {
    display: inline-block !important;
    margin-right: 10px !important;
    margin-bottom: 10px !important;
    vertical-align: top !important;
    width: auto !important;
}

/* Select styles */
.layui-form select {
    background-color: rgba(10, 14, 39, 0.8) !important;
    border: 1px solid rgba(0, 255, 255, 0.3) !important;
    color: #00ffff !important;
    padding: 10px !important;
    border-radius: 5px !important;
}

/* Label styles */
.layui-form label {
    color: #00ffff !important;
    font-weight: bold !important;
}

/* Modal styles */
#editModal {
    background-color: rgba(10, 14, 39, 0.95) !important;
    border: 1px solid rgba(0, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    padding: 20px !important;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3) !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1000 !important;
    width: 90% !important;
    max-width: 800px !important;
    color: #00ffff !important;
}

/* Currency switch styles */
.currency-switch, .data-source-switch {
    margin-bottom: 20px !important;
}

.currency-switch button, .data-source-switch button {
    margin-right: 10px !important;
    background: rgba(10, 14, 39, 0.8) !important;
    color: #00ffff !important;
    border: 1px solid #00ffff !important;
    padding: 8px 15px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-size: 14px !important;
}

.currency-switch button:hover, .data-source-switch button:hover {
    background: linear-gradient(135deg, #8a2be2, #00ffff) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6) !important;
    transform: translateY(-2px) !important;
}

.currency-switch button.active, .data-source-switch button.active {
    background: linear-gradient(135deg, #00ffff, #8a2be2) !important;
    color: #0a0e27 !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5) !important;
    transform: translateY(0) !important;
}

/* Exchange rate display */
.exchange-rate {
    background-color: rgba(138, 43, 226, 0.15) !important;
    padding: 10px 20px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(138, 43, 226, 0.3) !important;
    font-weight: bold !important;
    color: #8a2be2 !important;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5) !important;
}

/* Special highlight styles */
.special-highlight {
    color: #ff6b00 !important;
    animation: blink 1s infinite !important;
    font-weight: bold !important;
}

@keyframes blink {
    0%, 100% { opacity: 1; text-shadow: 0 0 5px rgba(255, 107, 0, 0.7); }
    50% { opacity: 0.7; text-shadow: 0 0 15px rgba(255, 107, 0, 1); }
}

/* Chart container styles */
.chart-container {
    background-color: rgba(10, 14, 39, 0.8) !important;
    padding: 20px !important;
    border-radius: 8px !important;
    margin: 20px 0 !important;
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1) !important;
}

.chart {
    margin-bottom: 20px !important;
}

/* ECharts styles */
.echarts-container {
    background-color: transparent !important;
}

/* ECharts text styles */
.echarts-tooltip {
    color: #00ffff !important;
    background-color: rgba(10, 14, 39, 0.9) !important;
    border: 1px solid rgba(0, 255, 255, 0.3) !important;
    border-radius: 5px !important;
}

/* Ensure ECharts canvas background is transparent */
.chart canvas {
    background-color: transparent !important;
}

/* Set default text color for all ECharts text elements */
.echarts-title, .echarts-axis-label, .echarts-axis-name, 
.echarts-legend-text, .echarts-series-label, .echarts-tooltip-text {
    color: #00ffff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Base styles */
    body {
        padding: 10px !important;
    }
    
    /* Container adjustments */
    .layui-container {
        padding: 0 10px !important;
    }
    
    /* Header adjustments */
    h1 {
        font-size: 1.8rem !important;
        margin: 15px 0 !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
        margin: 10px 0 !important;
    }
    
    /* Table adjustments */
    .layui-table {
        font-size: 11px !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    
    .layui-table th, .layui-table td {
        padding: 6px 3px !important;
        font-size: 11px !important;
    }
    
    /* Form adjustments */
    .layui-form {
        padding: 15px !important;
    }
    
    .layui-form-item {
        margin-bottom: 15px !important;
    }
    
    .layui-inline {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
    }
    
    /* Input adjustments */
    .layui-input {
        padding: 8px !important;
        font-size: 13px !important;
    }
    
    /* Button adjustments */
    .layui-btn {
        padding: 8px 15px !important;
        font-size: 13px !important;
        width: 100% !important;
        margin-bottom: 5px !important;
    }
    
    /* Chart adjustments */
    .chart-container {
        padding: 15px !important;
    }
    
    .chart {
        height: 300px !important;
        max-width: 100% !important;
    }
    
    /* Modal adjustments */
    #editModal {
        width: 95% !important;
        padding: 15px !important;
    }
    
    /* Currency switch adjustments */
    .currency-switch {
        margin-bottom: 15px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    .currency-switch button {
        margin-right: 5px !important;
        margin-bottom: 5px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    
    /* Exchange rate adjustments */
    .exchange-rate {
        padding: 8px 15px !important;
        font-size: 13px !important;
        margin-bottom: 15px !important;
    }
    
    /* Summary container adjustments */
    .summary-container {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 15px !important;
    }
    
    .summary-item {
        font-size: 14px !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    /* Navigation link adjustments */
    .nav-link {
        font-size: 16px !important;
        margin: 0 3px !important;
    }
    
    /* Table container for horizontal scrolling */
    .table-container {
        overflow-x: auto !important;
        margin: 15px 0 !important;
    }
    
    /* Ensure tables can be scrolled horizontally */
    .table-container table {
        min-width: 600px !important;
    }
    
    /* Adjust input container for mobile */
    .input-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .input-container input {
        width: 100% !important;
        margin-bottom: 5px !important;
    }
    
    .input-container button {
        width: 100% !important;
    }
}

/* Additional responsive adjustments for smaller screens */
@media (max-width: 480px) {
    /* Further reduce header font size */
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    /* Further reduce table font size */
    .layui-table {
        font-size: 10px !important;
    }
    
    .layui-table th, .layui-table td {
        padding: 5px 2px !important;
        font-size: 10px !important;
    }
    
    /* Further reduce button padding */
    .layui-btn {
        padding: 7px 12px !important;
        font-size: 12px !important;
    }
    
    /* Further reduce chart height */
    .chart {
        height: 250px !important;
    }
    
    /* Adjust currency switch layout */
    .currency-switch {
        flex-direction: column !important;
    }
    
    .currency-switch button {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/* Link styles */
a {
    color: #00ffff !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-bottom: 1px dashed rgba(0, 255, 255, 0.5) !important;
}

a:hover {
    color: #8a2be2 !important;
    border-bottom-color: #8a2be2 !important;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.7) !important;
}

/* Navigation link styles */
.nav-link {
    color: #00ffff !important;
    font-size: 20px !important;
    margin: 0 5px !important;
    border-bottom: none !important;
}

.nav-link:hover {
    color: #8a2be2 !important;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.7) !important;
}

/* Flash interest styles */
.flash-interest {
    color: #ff6b00 !important;
    animation: flash-interest 1s infinite !important;
    font-weight: bold !important;
}

@keyframes flash-interest {
    0%, 100% { color: #ff6b00; text-shadow: 0 0 5px rgba(255, 107, 0, 0.7); }
    50% { color: #ffff00; text-shadow: 0 0 15px rgba(255, 255, 0, 1); }
}

/* Market value highlight */
.buy-market-value {
    color: #00bfff !important;
    font-weight: bold !important;
}

.current-market-value {
    color: #ff00ff !important;
    font-weight: bold !important;
}

/* Total profit loss difference */
.total-profit-loss-difference {
    color: #ff4444 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5) !important;
}

/* Average cost display */
.average-cost-per-crypto {
    color: #00ff88 !important;
}

.average-cost-per-crypto .crypto-name {
    color: #00ffff !important;
    font-weight: bold !important;
}

.average-cost-per-crypto .crypto-price {
    color: #8a2be2 !important;
    font-weight: bold !important;
}

/* Price change indicators */
.price-up {
    color: #00ff88 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5) !important;
}

.price-down {
    color: #ff4444 !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5) !important;
}

/* Flash quantity */
.flash-quantity {
    animation: flash 1s infinite !important;
    font-weight: bold !important;
    color: #ffff00 !important;
}

@keyframes flash {
    0%, 100% { text-shadow: 0 0 5px rgba(255, 255, 0, 0.7); }
    50% { text-shadow: 0 0 20px rgba(255, 255, 0, 1); }
}
