:root {
    /* Colors extracted from the user's screenshot */
    --bg-color: #2F3651;
    /* Dark Indigo/Blue background */
    --card-bg: #404868;
    /* Slightly lighter for cards */
    --primary-color: #F87754;
    /* Orange/Red from flowers */
    --primary-hover: #E05D3A;
    --accent-yellow: #FACB4E;
    /* Yellow/Gold from text */
    --accent-blue: #6DB3D8;
    /* Light blue from swirls */
    --text-primary: #FFF8E7;
    /* Cream/Off-white for text to match the retro vibe */
    --text-secondary: #D4D8E6;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

.app-container {
    width: 100%;
    max-width: 500px;
    /* Minimalist: tighter width */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

.app-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

header p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
}

.editor-section {
    background: transparent;
    /* Minimalist: remove card background or make it very subtle */
    /* Alternatively, consistent with screenshot, maybe just the dark bg */
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: none;
}

/* Minimalist Card for Canvas */
.canvas-container {
    width: 100%;
    /* No border or simple border */
    border-radius: 12px;
    overflow: hidden;
    background: #1a1f33;
    position: relative;
    cursor: grab;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-container:hover {
    border-color: var(--accent-yellow);
}

.canvas-container.active {
    border-style: solid;
    border-color: transparent;
}

canvas {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(47, 54, 81, 0.6);
    /* Match bg color with opacity */
    backdrop-filter: blur(2px);
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s;
}

.canvas-container.has-image .upload-overlay {
    opacity: 0;
}

.upload-icon {
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
}

.controls {
    width: 100%;
    opacity: 1;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controls.hide,
.caption-section.hide {
    display: none;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 50px;
    /* Pill shape */
}

.slider-group label {
    font-weight: 600;
    color: var(--accent-yellow);
    font-size: 0.9rem;
}

input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    appearance: none;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-yellow);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-color);
}

.instruction {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 50px;
    /* Minimalist pill buttons */
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
}

.btn:active {
    transform: scale(0.98);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
}

.secondary-btn:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.caption-section {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.caption-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-yellow);
    text-align: center;
}

.caption-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

textarea {
    width: 100%;
    height: 100px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
}

textarea:focus {
    border-color: var(--accent-yellow);
}

/* Success state for copy button */
.btn.success {
    background: var(--accent-blue);
    color: #1e293b;
    border-color: var(--accent-blue);
}

footer {
    display: none;
    /* Explicitly hide just in case */
}

/* Loading Pop-up Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(47, 54, 81, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--accent-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}