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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 5px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 15px;
    padding: 5px 0;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    position: relative;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Section */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: fit-content;
}

.form-section h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.form-group select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 5px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.results-section h2 {
    color: white;
    font-size: 1.3em;
    margin-bottom: 5px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

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

.result-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.result-card.mrp-card {
    border-left: 5px solid #667eea;
}

.result-card.dom-card {
    border-left: 5px solid #764ba2;
}

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

.result-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.result-item label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.result-item .value {
    display: block;
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
}

.result-item .value.highlight {
    color: #667eea;
    font-size: 1.6em;
}

.market-context,
.timeline,
.price-analysis {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.market-context p,
.timeline p,
.price-analysis p {
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}

.market-context ul,
.timeline ul {
    list-style: none;
    padding-left: 0;
}

.market-context li,
.timeline li {
    color: #555;
    padding: 5px 0;
}

.market-context li::before,
.timeline li::before {
    content: "→ ";
    color: #667eea;
    font-weight: 600;
    margin-right: 8px;
}

.price-analysis p {
    margin-bottom: 8px;
}

/* Spinner */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

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

/* Error Message */
.error-message {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    header p {
        font-size: 1em;
    }

    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
