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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 3rem 0;
    color: white;
}

.header-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInDown 1s ease-out;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

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

.card h2 {
    color: #4c51bf;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Input Styles */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

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

.input-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.select-input, .number-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.select-input:focus, .number-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.number-input:hover, .select-input:hover {
    border-color: #cbd5e0;
}

.currency-toggle {
    margin-top: 0.5rem;
}

.currency-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    font-size: 0.9rem;
    color: #666;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Styles */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.result-card:hover {
    transform: scale(1.05);
}

.profit-card { border-left: 5px solid #48bb78; }
.return-card { border-left: 5px solid #667eea; }
.gain-card { border-left: 5px solid #ed8936; }
.annual-card { border-left: 5px solid #9f7aea; }

.result-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.result-content h3 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    animation: countUp 1s ease-out;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    margin: 1rem 0;
}

/* Exchange Rate Info */
.exchange-info {
    display: grid;
    gap: 1rem;
}

.exchange-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.exchange-item .label {
    font-weight: 600;
    color: #555;
}

.exchange-item .value {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
}

/* Fun Facts */
.fun-facts {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: none;
}

.facts-container {
    display: grid;
    gap: 1rem;
}

.fact-item {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #f56565;
    font-style: italic;
}

/* Stock Information */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stock-card {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border-radius: 15px;
    padding: 1.5rem;
    border: 2px solid rgba(56, 178, 172, 0.2);
    transition: transform 0.3s ease;
}

.stock-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(56, 178, 172, 0.2);
}

.stock-symbol {
    font-size: 1.3rem;
    font-weight: 700;
    color: #285e61;
    margin-bottom: 0.5rem;
}

.stock-name {
    color: #2c7a7b;
    font-weight: 500;
    margin-bottom: 1rem;
}

.stock-info {
    display: grid;
    gap: 0.5rem;
}

.stock-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.stock-metric .label {
    color: #4a5568;
}

.stock-metric .value {
    font-weight: 600;
    color: #285e61;
}

/* Data Tables */
.data-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: transparent;
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tab-content {
    display: none;
}

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

.data-table-container {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.data-table tr:hover td {
    background-color: #f7fafc;
}

.positive {
    color: #48bb78;
    font-weight: 600;
}

.negative {
    color: #f56565;
    font-weight: 600;
}

.stock-selector {
    margin-bottom: 1.5rem;
}

.stock-selector select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    min-width: 250px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .data-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .calculate-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }

/* Success/Error States */
.success {
    background-color: #f0fff4;
    border-color: #9ae6b4;
    color: #276749;
}

.error {
    background-color: #fed7d7;
    border-color: #feb2b2;
    color: #c53030;
}

.warning {
    background-color: #fefcbf;
    border-color: #faf089;
    color: #744210;
}

/* Glassmorphism effect for cards */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Hover effects for interactive elements */
.interactive:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}