/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Border Colors */
    --border-color: #334155;
    --border-hover: #475569;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    position: relative;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.language-selector:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.language-selector label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

.language-selector label i {
    color: var(--primary-color);
}

.language-selector select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding: 0;
    min-width: 80px;
}

.language-selector select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content h1 i {
    color: #f7931a;
    margin-right: var(--spacing-sm);
}

.header-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-xl);
}

.card h2, .card h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.intro-section .card h2 {
    margin-bottom: 0;
}

.card h2 i, .card h3 i {
    color: var(--primary-color);
}

/* Introduction Section */
.intro-section {
    margin-bottom: var(--spacing-xl);
}

.intro-content {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.intro-content.collapsed {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
}

.intro-content.expanded {
    max-height: 3000px;
    opacity: 1;
    margin-bottom: var(--spacing-md);
}

.intro-content p {
    margin-bottom: var(--spacing-md);
}

.intro-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.intro-content ul {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.toggle-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-sm);
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: all 0.3s ease;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    top: -10px;
}

.toggle-intro:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.toggle-intro i {
    margin-left: var(--spacing-sm);
    transition: transform 0.3s ease;
}

.toggle-intro.expanded i {
    transform: rotate(180deg);
}

.intro-content ul li {
    margin-bottom: var(--spacing-xs);
}

.intro-content ul li strong {
    color: var(--primary-color);
}

/* Form Styles */
.form-section {
    margin-bottom: var(--spacing-xl);
}

.dca-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    align-items: end;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input,
.form-group select {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    grid-column: 1 / -1;
    justify-self: center;
    min-width: 200px;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--border-hover);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.summary-card.green::before {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.summary-card.blue::before {
    background: linear-gradient(135deg, var(--info-color), #1d4ed8);
}

.summary-card.purple::before {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.summary-card.profit::before {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.summary-card.loss::before {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.summary-card.green .card-icon {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.summary-card.blue .card-icon {
    background: linear-gradient(135deg, var(--info-color), #1d4ed8);
}

.summary-card.purple .card-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.card-content h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.card-content p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart Section */
.chart-section {
    margin-bottom: var(--spacing-xl);
}

.chart-section .card {
    height: 500px;
}

.chart-section canvas {
    max-width: 100%;
    height: 400px !important;
    max-height: 400px !important;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: var(--spacing-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

table th {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table td {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: var(--bg-card);
}

/* Export Section */
.export-section {
    text-align: center;
    margin-top: var(--spacing-xl);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Support Section */
.support-section {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px dashed var(--border-color);
}

.support-section h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    color: var(--text-color);
}

.crypto-addresses {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.crypto-address {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
}

.crypto-name {
    font-weight: 600;
    margin-right: var(--spacing-xs);
}

.crypto-value {
    font-family: monospace;
    background-color: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 2px;
    word-break: break-all;
}

@media (min-width: 768px) {
    .crypto-address {
        flex-direction: row;
        justify-content: center;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
    }
    
    /* Language selector adjustments for mobile */
    .header {
        padding: var(--spacing-md) 0;
    }
    
    .language-selector {
        position: static;
        align-self: flex-end;
        margin-bottom: var(--spacing-md);
        order: -1;
    }
    
    .header-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .dca-form {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .chart-section .card {
        height: 400px;
    }
    
    .chart-section canvas {
        height: 280px !important;
        max-height: 280px !important;
    }
    
    .table-container {
        font-size: 0.875rem;
    }
    
    table th,
    table td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    /* Language selector for very small screens */
    .language-selector {
        width: 100%;
        justify-content: center;
        margin-bottom: var(--spacing-lg);
    }
    
    .header-content h1 {
        font-size: 1.75rem;
    }
    
    .summary-card {
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .card-content p {
        font-size: 1.25rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Utility Classes */
.text-success {
    color: var(--secondary-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}