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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #333;
}

header {
    text-align: center;
    padding: 3rem 1rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.converter-section {
    margin-bottom: 2rem;
}

.converter-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.input-group {
    margin-bottom: 1.5rem;
}

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

.input-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #f7931a;
}

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

.currency-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.currency-selector select {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.currency-selector select:focus {
    outline: none;
    border-color: #f7931a;
}

.swap-button {
    text-align: center;
    margin: 1rem 0;
}

.swap-button button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #f7931a;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(247, 147, 26, 0.3);
}

.swap-button button:hover {
    transform: rotate(180deg);
    background: #e8821a;
}

.result-display {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.result-amount {
    font-size: 3rem;
    font-weight: bold;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.result-currency {
    font-size: 1.5rem;
    color: #666;
}

.rate-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.update-time {
    font-size: 0.8rem;
}

.price-chart {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
}

.price-chart h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.chart-container {
    height: 300px;
    margin-bottom: 1rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.period-btn:hover,
.period-btn.active {
    border-color: #f7931a;
    background: #f7931a;
    color: white;
}

.market-overview {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
}

.market-overview h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.market-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s;
}

.market-item:hover {
    transform: translateY(-3px);
}

.market-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.market-item-name {
    font-weight: 600;
    color: #333;
}

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

.market-item-price {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.market-item-change {
    font-size: 0.9rem;
}

.positive {
    color: #10b981;
}

.negative {
    color: #ef4444;
}

.calculator-tools {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
}

.calculator-tools h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
}

.tool-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.tool-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-inputs input {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.tool-inputs button,
#addPortfolio,
#calcPortfolio {
    padding: 0.8rem 1.5rem;
    background: #f7931a;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.tool-inputs button:hover,
#addPortfolio:hover,
#calcPortfolio:hover {
    background: #e8821a;
}

.tool-result {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.portfolio-currency,
.portfolio-amount {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.news-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.news-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

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

.news-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.news-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.news-item h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.news-item p {
    color: #666;
    margin-bottom: 0.5rem;
}

.news-date {
    font-size: 0.8rem;
    color: #999;
}

footer {
    background: rgba(255,255,255,0.95);
    padding: 3rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.ad-area {
    background: #f5f5f5;
    border: 2px dashed #ddd;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-area p {
    color: #999;
}

.disclaimer {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .result-amount {
        font-size: 2rem;
    }
    
    .market-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
}