:root {
    --primary-color: #4CAF50; /* A pleasant green */
    --secondary-color: #FFC107; /* An accent yellow */
    --background-color: #f4f7f6;
    --text-color: #333;
    --footer-bg-color: #333;
    --footer-text-color: #f4f7f6;
    --border-radius: 8px;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@layer base {
    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        line-height: 1.6;
        margin: 0;
        padding: 0;
        background-color: var(--background-color);
        color: var(--text-color);
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    header {
        background-color: var(--primary-color);
        color: white;
        padding: 1rem 0;
        text-align: center;
        box-shadow: var(--shadow);
    }

    h1 {
        margin: 0;
        font-size: 2.5rem;
    }

    main {
        flex: 1;
        padding: 20px;
        max-width: 960px;
        margin: 20px auto;
        background-color: white;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
    }

    footer {
        background-color: var(--footer-bg-color);
        color: var(--footer-text-color);
        text-align: center;
        padding: 1rem 0;
        margin-top: 20px;
    }
}

/* Responsive design using container queries for future components */
@container (max-width: 768px) {
    main {
        margin: 10px;
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }
}

@container (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
}

/* Stock Recommender Specific Styles */
.search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

#stock-search {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
    flex-grow: 1; /* Allow input to grow */
    max-width: 400px; /* Limit max width */
}

#get-recommendations {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#get-recommendations:hover {
    background-color: #45a049; /* Slightly darker green on hover */
}

#stock-recommendations-results {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    background-color: #fdfdfd;
    min-height: 100px; /* Ensure visibility even when empty */
}

.stock-item {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

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

.stock-item h3 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

.stock-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

/* Responsive adjustments for search container */
@container (max-width: 600px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    #stock-search,
    #get-recommendations {
        max-width: none; /* Remove max-width on smaller screens */
        width: 100%;
    }
}