/*
 * Basic styles for Merek.AI.
 * This stylesheet provides a clean and responsive layout for the
 * brand analysis website. It defines styles for the container,
 * headings, forms, result sections, and the error message.
 */

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 40px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    color: #007bff;
}

header p {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #555;
}

.error {
    background-color: #ffefef;
    border: 1px solid #ff7a7a;
    color: #b30000;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

form.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

fieldset {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 4px;
}

legend {
    font-weight: bold;
    padding: 0 8px;
    color: #007bff;
}

label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.submit-btn {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    align-self: flex-start;
}

.submit-btn:hover {
    background-color: #0056b3;
}

.analysis-section {
    margin-bottom: 20px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.analysis-section h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #007bff;
}

.analysis-section p {
    margin: 4px 0;
    line-height: 1.4;
}

.analysis-section.final {
    border-top: 2px solid #007bff;
    padding-top: 15px;
    margin-top: 30px;
}

/* Loading overlay styling */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Preview images styling */
.preview-images img {
    max-width: 100px;
    max-height: 100px;
    margin-top: 10px;
    display: none;
    border: 1px solid #ccc;
    padding: 4px;
    border-radius: 4px;
}

/* Animation for analysis results: sections start hidden and fade/slide in */
.analysis-section {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.analysis-section.show {
    opacity: 1;
    transform: translateY(0);
}

nav a {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: #666;
}

.note {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
}