/* General Reset and Base Styles */
:root {
    --color-primary: #00C896; /* Teal/Mint green for action/accent */
    --color-secondary: #1F2937; /* Dark background */
    --color-background: #111827; /* Deep charcoal/blue-black */
    --color-text-light: #F9FAFB;
    --color-text-muted: #9CA3AF;
    --color-error: #EF4444;
    --spacing-unit: 1rem;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-unit);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #00E0A7;
}

/* Header */
header {
    background-color: var(--color-secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 1.8rem;
    color: var(--color-primary);
    margin: 0;
}

header p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.anycoder-link {
    font-weight: bold;
}

/* Main Content */
main {
    flex-grow: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

h2 {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 0.5rem;
    font-size: 1.5rem;
}

/* Prompt Section */
.prompt-section {
    margin-bottom: 2rem;
    background-color: var(--color-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#generator-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#prompt-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-secondary);
    border-radius: 6px;
    background-color: #1F2937;
    color: var(--color-text-light);
    resize: none;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#prompt-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

#generate-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}

#generate-button:hover:not(:disabled) {
    background-color: #00E0A7;
}

#generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.guidance {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Results Section */
.results-section {
    margin-top: 3rem;
}

#results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.initial-message {
    color: var(--color-text-muted);
    text-align: center;
    padding: 2rem;
    background-color: var(--color-secondary);
    border-radius: 8px;
}

/* Individual Result Card */
.result-card {
    background-color: var(--color-secondary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-prompt {
    font-style: italic;
    color: var(--color-text-light);
    padding: 0.5rem;
    background-color: #374151;
    border-radius: 4px;
    word-wrap: break-word;
}

.image-output {
    min-height: 250px;
    background-color: #2D3748;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--color-primary);
}

/* Placeholder for Generated Image (Simulation) */
.tentacle-simulation {
    width: 80%;
    height: 80%;
    background: radial-gradient(circle at 30% 70%, #00C896, #00A37A);
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(0, 200, 150, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: pulse 4s infinite alternate;
    /* This simulates the complex curved shape */
    transform: rotate(45deg);
}

.tentacle-simulation::before,
.tentacle-simulation::after {
    content: '';
    position: absolute;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}
.tentacle-simulation::before {
    width: 60%;
    height: 60%;
    top: -10%;
    left: 40%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transform: rotate(15deg);
}
.tentacle-simulation::after {
    width: 40%;
    height: 40%;
    bottom: 10%;
    right: 30%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transform: rotate(-15deg);
}

@keyframes pulse {
    0% { transform: scale(1.0) rotate(45deg); opacity: 0.9; }
    100% { transform: scale(1.05) rotate(47deg); opacity: 1; }
}

/* Loading State */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    color: var(--color-primary);
    font-size: 1.1rem;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Footer */
footer {
    background-color: var(--color-secondary);
    padding: 1rem 0;
    text-align: center;
    margin-top: auto;
}

footer p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Mobile Responsiveness */
@media (min-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }

    .prompt-section, .results-section {
        padding: 2rem;
    }
}

@media (min-width: 768px) {
    #generator-form {
        flex-direction: row;
    }

    #prompt-input {
        flex-grow: 1;
        margin-right: 1rem;
    }
    
    #generate-button {
        width: 30%;
        min-width: 200px;
        margin-left: 1rem;
    }
    
    .result-card {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .result-details {
        flex-basis: 30%;
        padding-right: 1rem;
    }
    
    .image-output {
        flex-basis: 70%;
        height: 300px;
    }
}

@media (min-width: 1024px) {
    h2 {
        font-size: 1.8rem;
    }
}