/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #010f09; /* onyx 400 */
    background: linear-gradient(135deg, #003e1f 0%, #003118 100%); /* deep_forest DEFAULT -> 400 */
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #003e1f 0%, #003118 100%); /* deep_forest DEFAULT -> 400 */
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 40px;
}

/* Input Section */
.input-section {
    background: #f6fcf9; /* honeydew 900 */
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.input-section h2 {
    margin-bottom: 20px;
    color: #003e1f; /* deep_forest DEFAULT */
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #010c07; /* onyx 300 */
}

.form-group textarea,
.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #abd6c3; /* muted_teal 700 */
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: #003e1f; /* deep_forest DEFAULT */
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #000805; /* onyx 200 */
    font-size: 0.9rem;
}

button[type="submit"] {
    background: linear-gradient(135deg, #003e1f 0%, #003118 100%); /* deep_forest DEFAULT -> 400 */
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 62, 31, 0.4); /* deep_forest DEFAULT with opacity */
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #003e1f; /* deep_forest DEFAULT */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loadingText {
    font-size: 1.2rem;
    color: #003e1f; /* deep_forest DEFAULT */
    font-weight: 500;
}

/* Summary Section */
.summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.summary-card {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    background: #f6fcf9; /* honeydew 900 */
}

.summary-card h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.summary-card p {
    color: #000805; /* onyx 200 */
    font-size: 0.9rem;
    text-transform: uppercase;
}

.summary-card.buy { background: #e3f1eb; /* muted_teal 900 */ color: #14281f; /* muted_teal 100 */ }
.summary-card.sell { background: #fccfc4; /* brick_ember 900 */ color: #260902; /* brick_ember 100 */ }
.summary-card.hold { background: #f6fcf9; /* honeydew 900 */ color: #15452d; /* honeydew 100 */ }
.summary-card.total { background: #e5f7ee; /* honeydew 700 */ color: #15452d; /* honeydew 100 */ }

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.stock-card {
    border: 2px solid #abd6c3; /* muted_teal 700 */
    border-radius: 8px;
    padding: 20px;
    background: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stock-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stock-card.buy { border-color: #73ba9b; /* muted_teal DEFAULT */ }
.stock-card.sell { border-color: #ba2d0b; /* brick_ember DEFAULT */ }
.stock-card.hold { border-color: #8fdcb4; /* honeydew 400 */ }

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e3f1eb; /* muted_teal 900 */
}

.ticker {
    font-size: 1.5rem;
    font-weight: bold;
    color: #010f09; /* onyx 400 */
}

.signal-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.signal-badge.buy { background: #73ba9b; /* muted_teal DEFAULT */ }
.signal-badge.sell { background: #ba2d0b; /* brick_ember DEFAULT */ }
.signal-badge.hold { background: #8fdcb4; /* honeydew 400 */ color: #010f09; /* onyx 400 */ }

.price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #003e1f; /* deep_forest DEFAULT */
    margin-bottom: 10px;
}

.confidence {
    font-size: 1rem;
    color: #000805; /* onyx 200 */
    margin-bottom: 15px;
}

.indicators {
    background: #f6fcf9; /* honeydew 900 */
    padding: 15px;
    border-radius: 6px;
}

.indicators h4 {
    margin-bottom: 10px;
    color: #010c07; /* onyx 300 */
}

/* Error Section */
.error-section {
    padding: 20px;
}

.error-message {
    background: #fccfc4; /* brick_ember 900 */
    border: 2px solid #ba2d0b; /* brick_ember DEFAULT */
    border-radius: 8px;
    padding: 20px;
    color: #260902; /* brick_ember 100 */
}

.error-message h3 {
    margin-bottom: 10px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #f6fcf9; /* honeydew 900 */
    color: #000805; /* onyx 200 */
    font-size: 0.9rem;
}

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

    .results-grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 20px;
    }
}

/* Indicator Sections */
.indicators-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.indicator-section {
    background: #f6fcf9; /* honeydew 900 */
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #73ba9b; /* muted_teal DEFAULT - Moving Averages */
}

.indicator-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #010c07; /* onyx 300 */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e3f1eb; /* muted_teal 900 */
}

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

.indicator-label {
    font-size: 0.85rem;
    color: #000805; /* onyx 200 */
}

.indicator-value {
    font-weight: 600;
    color: #010c07; /* onyx 300 */
    font-size: 0.9rem;
}

/* Trend Section */
.trend-section {
    border-left-color: #003e1f; /* deep_forest DEFAULT */
}

.trend-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trend-item .label {
    font-size: 0.85rem;
    color: #000805; /* onyx 200 */
}

.trend-item .value {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.trend-item .value.bullish {
    background: #e3f1eb; /* muted_teal 900 */
    color: #14281f; /* muted_teal 100 */
}

.trend-item .value.bearish {
    background: #fccfc4; /* brick_ember 900 */
    color: #260902; /* brick_ember 100 */
}

/* Support/Resistance Section */
.sr-section {
    border-left-color: #ba2d0b; /* brick_ember DEFAULT */
}

.sr-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sr-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sr-item .label {
    font-size: 0.75rem;
    color: #000805; /* onyx 200 */
    text-transform: uppercase;
}

.sr-item .value {
    font-weight: 700;
    color: #010c07; /* onyx 300 */
    font-size: 1rem;
}

.sr-item .distance {
    font-size: 0.75rem;
    color: #000805; /* onyx 200 */
    font-style: italic;
}

.position-near-support {
    color: #14281f !important; /* muted_teal 100 */
    background: #e3f1eb; /* muted_teal 900 */
}

.position-near-resistance {
    color: #260902 !important; /* brick_ember 100 */
    background: #fccfc4; /* brick_ember 900 */
}

.position-middle {
    color: #15452d !important; /* honeydew 100 */
    background: #f6fcf9; /* honeydew 900 */
}

/* Individual Signals Section */
.signals-section {
    grid-column: 1 / -1;
    margin-top: 1rem;
    padding: 1.5rem;
    background: #f6fcf9; /* honeydew 900 */
    border-radius: 8px;
    border: 1px solid #e3f1eb; /* muted_teal 900 */
}

.signals-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #010c07; /* onyx 300 */
}

.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.signal-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e3f1eb; /* muted_teal 900 */
}

.signal-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: #000805; /* onyx 200 */
    text-transform: uppercase;
}

.signal-badge.buy {
    background: #73ba9b; /* muted_teal DEFAULT */
    color: white;
}

.signal-badge.sell {
    background: #ba2d0b; /* brick_ember DEFAULT */
    color: white;
}

.signal-badge.neutral {
    background: #000805; /* onyx 200 */
    color: white;
}

.signal-reason {
    font-size: 0.8rem;
    color: #010c07; /* onyx 300 */
}

.signal-strength {
    font-size: 0.75rem;
    color: #000805; /* onyx 200 */
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .indicators-container {
        grid-template-columns: 1fr;
    }

    .signals-grid {
        grid-template-columns: 1fr;
    }
}
