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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

/* Header */
.app-header {
    text-align: center;
    padding: 24px 0;
    margin-bottom: 16px;
}

.logo {
    font-size: 48px;
    margin-bottom: 8px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Upload Section */
.upload-section {
    animation: fadeIn 0.5s ease;
}

.upload-box {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover, .upload-box.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.sample-graphs {
    margin-top: 24px;
    text-align: center;
}

.sample-graphs p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sample-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.sample-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Analysis Section */
.analysis-section {
    animation: slideUp 0.5s ease;
}

.graph-display {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    height: 280px;
}

.graph-display canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Prediction Card */
.prediction-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.prediction-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.prediction-icon {
    font-size: 32px;
}

.prediction-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.prediction-result {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.prediction-result.bullish {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
}

.prediction-result.bearish {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
}

.prediction-result.sideways {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
}

.direction {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.direction.up {
    color: var(--success);
}

.direction.down {
    color: var(--danger);
}

.direction.neutral {
    color: var(--warning);
}

.confidence {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Analysis Details */
.analysis-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
}

.detail-item .label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-item .value {
    font-size: 14px;
    font-weight: 600;
}

.value.bullish { color: var(--success); }
.value.bearish { color: var(--danger); }
.value.neutral { color: var(--warning); }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

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

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

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

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

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .app-container {
        padding: 12px;
    }
    
    .upload-box {
        padding: 32px 20px;
    }
    
    .graph-display {
        height: 240px;
    }
    
    .analysis-details {
        grid-template-columns: 1fr;
    }
}