/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 50%, #1a202c 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.logo-image {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.logo-text {
    text-align: left;
}

.logo-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    margin: 0;
}

/* Main content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Cards */
.analysis-card, .results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 8px;
}

.card-header p {
    color: #4a5568;
    font-size: 1rem;
}

/* Form */
.analysis-form {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.form-group label {
    font-weight: 500;
    color: #1a365d;
    font-size: 0.95rem;
}

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00bcd4;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.2);
}

.analyze-btn {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    flex: 1;
    min-width: 150px;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 188, 212, 0.4);
}

.analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.forecast-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    flex: 1;
    min-width: 150px;
}

.forecast-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.forecast-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results */
.results-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a365d;
}

.signal-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signal-badge.buy {
    background: #c6f6d5;
    color: #22543d;
}

.signal-badge.sell {
    background: #fed7d7;
    color: #742a2a;
}

.signal-badge.hold {
    background: #fef5e7;
    color: #744210;
}

/* Summary grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.summary-card {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.summary-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a365d;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #00bcd4;
    border-bottom-color: #00bcd4;
}

.tab-btn:hover {
    color: #00bcd4;
}

.tab-content {
    padding: 30px;
}

.tab-panel {
    display: none;
}

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

/* Indicators grid */
.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.indicator-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.indicator-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 8px;
}

.indicator-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a365d;
}

/* MACD and SuperTrend sections */
.macd-section, .supertrend-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.macd-section h4, .supertrend-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 16px;
}

.macd-grid, .supertrend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.macd-item, .supertrend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.macd-label, .supertrend-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.macd-value, .supertrend-value {
    font-weight: 600;
    color: #2d3748;
}

.supertrend-trend {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.supertrend-trend.up {
    background: #c6f6d5;
    color: #22543d;
}

.supertrend-trend.down {
    background: #fed7d7;
    color: #742a2a;
}

/* Trading grid */
.trading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.trading-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.trading-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 8px;
}

.trading-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
}

/* Reasoning */
.reasoning-list {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
}

.reasoning-item {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
    color: #4a5568;
}

.reasoning-item:last-child {
    border-bottom: none;
}

.reasoning-item strong {
    color: #2d3748;
    font-weight: 600;
}

/* Forecast */
.forecast-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-size: 1rem;
}

.forecast-card {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.forecast-header h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.forecast-period {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    background: #e2e8f0;
    padding: 6px 12px;
    border-radius: 16px;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.forecast-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.forecast-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forecast-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
}

.forecast-value.positive {
    color: #22543d;
}

.forecast-value.negative {
    color: #742a2a;
}

.forecast-value.neutral {
    color: #718096;
}

.forecast-predicted {
    font-size: 1.6rem;
}

.forecast-model-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.model-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.model-label {
    color: #718096;
    font-weight: 500;
}

.model-info-item span:last-child {
    color: #2d3748;
    font-weight: 600;
}

.forecast-error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.forecast-error p {
    color: #742a2a;
    font-size: 0.95rem;
    margin: 0;
}

/* Error message */
.error-message {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.error-content h3 {
    color: #742a2a;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.error-content p {
    color: #742a2a;
    font-size: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo-image {
        height: 60px;
    }
    
    .logo-title {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .analysis-form {
        padding: 20px;
    }
    
    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        padding: 20px;
    }
    
    .indicators-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .tabs {
        padding: 0 20px;
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .results-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .indicators-grid {
        grid-template-columns: 1fr;
    }
    
    .trading-grid {
        grid-template-columns: 1fr;
    }
    
    .macd-grid, .supertrend-grid {
        grid-template-columns: 1fr;
    }
}
