/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Auth Section */
.auth-container {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.auth-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.auth-form {
    padding: 40px;
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.toggle-text {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.toggle-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.toggle-text a:hover {
    text-decoration: underline;
}

.features-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 40px;
    background: #f8f9fa;
}

.feature {
    text-align: center;
    padding: 20px;
}

.feature i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.feature h3 {
    margin-bottom: 10px;
    color: #333;
}

.feature p {
    color: #666;
    line-height: 1.5;
}

/* Dashboard Section */
.dashboard-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

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

.logo i {
    color: #667eea;
    font-size: 1.5rem;
}

.logo h1 {
    color: #333;
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.balance {
    font-weight: 600;
    color: #333;
}

.balance-amount {
    color: #28a745;
    font-weight: 700;
}

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

.user-profile span {
    font-weight: 600;
    color: #333;
}

/* Navigation */
.dashboard-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.nav-btn {
    padding: 15px 25px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-btn.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 3px solid #667eea;
}

/* Main Content */
.dashboard-main {
    padding: 30px 40px;
}

.tab-content {
    display: none;
}

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

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

.section-header h2 {
    font-size: 1.8rem;
    color: #333;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

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

.stat-header h3 {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

.stat-header i {
    color: #667eea;
    font-size: 1.2rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.stat-change {
    font-size: 0.9rem;
    color: #666;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

.stat-change i {
    margin-right: 5px;
}

/* Charts */
.charts-grid, .analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1rem;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

/* Crypto Grid */
.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.crypto-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.crypto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

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

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

.crypto-name i {
    font-size: 1.5rem;
}

.crypto-name h3 {
    font-size: 1.2rem;
    color: #333;
}

.crypto-symbol {
    color: #666;
    font-size: 0.9rem;
}

.price-change {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.price-change.positive {
    background: #d4edda;
    color: #155724;
}

.price-change.negative {
    background: #f8d7da;
    color: #721c24;
}

.crypto-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.crypto-info {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.crypto-market-cap, .crypto-volume {
    flex: 1;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.portfolio-holdings, .portfolio-stats {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.portfolio-holdings h3, .portfolio-stats h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1rem;
}

.portfolio-list {
    space-y: 10px;
}

.portfolio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.portfolio-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

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

.crypto-icon i {
    font-size: 1.2rem;
}

.crypto-name-small {
    font-weight: 600;
    color: #333;
}

.crypto-amount {
    font-weight: 600;
    color: #333;
}

.current-value {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.profit-loss {
    font-weight: 600;
}

.profit-loss.positive {
    color: #28a745;
}

.profit-loss.negative {
    color: #dc3545;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

/* Stat Boxes */
.stat-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.stat-box p:first-child {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-box .large-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.stat-box.profit .large-value {
    color: #28a745;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.modal-body {
    margin-top: 20px;
}

.current-price {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #333;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .invest-confirmation {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 70%;
    }
}

@media (max-width: 768px) {
    .auth-container, .dashboard-container {
        margin: 20px;
        border-radius: 10px;
    }
    
    .auth-header, .auth-form {
        padding: 30px;
    }
    
    .features-preview {
        grid-template-columns: 1fr;
    }
    
    .charts-grid, .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .modal-content {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        padding: 15px 15px;
        font-size: 14px;
    }
    
    .nav-btn i {
        font-size: 1rem;
    }
    
    .dashboard-main {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}