* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #0a0e27;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #e8eaf6;
}

.container {
    max-width: 900px;
    width: 100%;
    background: #1a1f3a;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1a1f3a 0%, #252b4a 100%);
    color: #ffffff;
    padding: 40px 40px 35px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.subtitle {
    font-size: 1em;
    opacity: 0.7;
    color: #b0b8d1;
    font-weight: 400;
}

main {
    padding: 50px 40px;
}

.upload-section {
    width: 100%;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 70px 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.upload-icon {
    color: #6366f1;
    margin-bottom: 8px;
    opacity: 0.8;
}

.upload-icon svg {
    stroke: #6366f1;
}

.upload-text {
    font-size: 1.1em;
    color: #b0b8d1;
    margin-bottom: 8px;
    font-weight: 400;
}

.upload-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    font-family: inherit;
}

.btn-primary {
    background: #6366f1;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: #b0b8d1;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.btn-analyze {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    font-size: 1.05em;
    background: #6366f1;
    color: #ffffff;
    font-weight: 500;
}

.btn-analyze:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.preview-section {
    margin-top: 30px;
}

.image-preview {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.btn-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(26, 31, 58, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #b0b8d1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.5);
}

.analysis-section {
    text-align: center;
    padding: 60px 20px;
}

.analysis-animation h2 {
    color: #ffffff;
    margin: 24px 0 40px;
    font-size: 1.6em;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.analysis-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 40px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.step {
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    font-size: 1em;
    opacity: 0.4;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #b0b8d1;
}

.step.active {
    opacity: 1;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #ffffff;
    transform: translateX(4px);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 0.9em;
    flex-shrink: 0;
}

.step.active .step-number {
    background: #6366f1;
    color: #ffffff;
}

.step-text {
    flex: 1;
    text-align: left;
}

.result-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signal-card {
    background: transparent;
    border-radius: 12px;
    padding: 0;
}

.signal-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.signal-header h2 {
    color: #ffffff;
    margin-bottom: 24px;
    font-size: 1.8em;
    font-weight: 500;
    letter-spacing: -0.3px;
    width: 100%;
}

.signal-badge {
    display: inline-block;
    padding: 16px 48px;
    border-radius: 10px;
    font-size: 1.4em;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 0;
}

.signal-badge.up {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.signal-badge.down {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.timeframe {
    margin-top: 16px;
    padding: 10px 24px;
    display: block;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: auto;
    max-width: 300px;
    text-align: center;
}

.timeframe span {
    color: #b0b8d1;
    font-size: 0.95em;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: block;
}

.analysis-text {
    margin-bottom: 40px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 3px solid #6366f1;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.analysis-text h3 {
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 1.2em;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.analysis-text p {
    line-height: 1.8;
    color: #b0b8d1;
    font-size: 1em;
}

.indicators {
    margin-bottom: 40px;
}

.indicators h3 {
    color: #ffffff;
    margin-bottom: 24px;
    font-size: 1.2em;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.indicator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.indicator-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.indicator-label {
    font-weight: 500;
    color: #b0b8d1;
    font-size: 0.95em;
}

.indicator-value {
    font-weight: 600;
    color: #6366f1;
    font-size: 1.05em;
    font-variant-numeric: tabular-nums;
}

#newAnalysisBtn {
    width: 100%;
    margin-top: 0;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px 25px;
    }
    
    header h1 {
        font-size: 1.6em;
    }
    
    main {
        padding: 30px 20px;
    }
    
    .upload-area {
        padding: 50px 20px;
    }
    
    .upload-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .upload-buttons .btn {
        width: 100%;
    }
    
    .indicators-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-steps {
        max-width: 100%;
    }
}
