:root {
    --brand-hue: 260;
    --bg-color: hsl(var(--brand-hue), 30%, 96%);
    --surface-color: hsla(var(--brand-hue), 40%, 100%, 0.7);
    --text-color: hsl(var(--brand-hue), 20%, 25%);
    --brand-color-light: hsl(var(--brand-hue), 90%, 70%);
    --brand-color: hsl(var(--brand-hue), 90%, 65%);
    --brand-color-dark: hsl(var(--brand-hue), 90%, 55%);
    --border-color: hsla(var(--brand-hue), 30%, 85%, 0.5);
}

body {
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin: 0;
    padding: 2rem 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image:
        radial-gradient(at 10% 15%, hsla(var(--brand-hue), 90%, 80%, 0.3) 0px, transparent 50%),
        radial-gradient(at 80% 20%, hsla(300, 90%, 80%, 0.3) 0px, transparent 50%),
        radial-gradient(at 20% 90%, hsla(210, 90%, 80%, 0.3) 0px, transparent 50%),
        radial-gradient(at 90% 85%, hsla(340, 90%, 80%, 0.3) 0px, transparent 50%);
    min-height: 100vh;
}

.container {
    max-width: 700px;
    margin: auto;
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    color: var(--brand-color);
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
    color: hsl(var(--brand-hue), 30%, 15%);
}

.subtitle {
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: hsl(var(--brand-hue), 15%, 45%);
}

form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Hide the default file input */
#fileInput {
    display: none;
}

/* Style the custom label and button */
.file-label, #generateButton {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.file-label {
    background-color: #fff;
    color: var(--text-color);
}

.file-label:hover {
    background-color: hsl(var(--brand-hue), 30%, 98%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#fileName {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#generateButton {
    background: linear-gradient(45deg, var(--brand-color-light), var(--brand-color));
    color: white;
    border-color: transparent;
}

#generateButton:hover {
    box-shadow: 0 4px 12px hsla(var(--brand-hue), 90%, 65%, 0.3);
    transform: translateY(-2px);
}

/* Style for the disabled button */
#generateButton:disabled {
    background: hsl(var(--brand-hue), 20%, 80%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: hsl(var(--brand-hue), 10%, 60%);
}

#generateButton:disabled span {
    display: none;
}

#generateButton.loading::after {
    content: "Generating...";
}

.hidden {
    display: none !important;
}

.spinner {
    margin: 20px auto 10px;
    border: 4px solid hsla(var(--brand-hue), 30%, 80%, 0.5);
    border-top: 4px solid var(--brand-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.processing-text {
    font-size: 1.1rem;
    font-weight: 500;
}

#results h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.output-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.result-item h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.media-container {
    background-color: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

video, img {
    max-width: 100%;
    display: block;
}

#error {
    margin-top: 1.5rem;
    color: #e53e3e;
    background-color: #fff0f0;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

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

@media (min-width: 640px) {
    .output-grid {
        grid-template-columns: 1fr 1fr;
    }
}

