:root {
    --bg-color: #0f172a; /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.85); /* Slate 800 with opacity */
    --primary: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb; /* Blue 600 */
    --secondary: #10b981; /* Emerald 500 */
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --border-color: rgba(148, 163, 184, 0.2); /* Slate 400 with opacity */
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] {
    --bg-color: #f1f5f9; /* Slate 100 - softer background */
    --card-bg: rgba(255, 255, 255, 0.95); /* More opaque white */
    --primary: #2563eb; /* Blue 600 */
    --primary-hover: #1d4ed8; /* Blue 700 */
    --secondary: #059669; /* Emerald 600 */
    --text-main: #1e293b; /* Slate 800 - softer than pure black */
    --text-muted: #64748b; /* Slate 500 */
    --border-color: rgba(148, 163, 184, 0.3); /* Slate 400 */
    --glass-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1), transparent 40%);
    z-index: -1;
    animation: pulse 20s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    z-index: 10;
}

.theme-toggle:hover {
    transform: scale(1.1);
    color: var(--primary);
    border-color: var(--primary);
}

header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

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

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Input Section */
.input-section form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus, .theme-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.options-row {
    display: flex;
    gap: 20px;
}

.theme-group, .logo-group {
    flex: 1;
}

.theme-select {
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-main);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.theme-select option {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px dashed var(--border-color);
    padding: 16px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover, .file-input:focus + .file-label, .file-upload.drag-over .file-label {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px 0;
    animation: fadeIn 0.5s ease;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255,255,255,0.1);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

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

/* Result Area */
.result-area {
    animation: slideUp 0.6s ease-out;
}

.hidden {
    display: none !important;
}

.card-header {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.card-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
}

.concept-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-group {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.detail-group:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.detail-group h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.image-header h3 {
    margin-bottom: 0;
}

.icon-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

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

.generated-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    margin-top: 15px;
    transition: transform 0.3s ease;
}

.generated-img:hover {
    transform: scale(1.02);
}

.error-text {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed rgba(239, 68, 68, 0.4);
    margin-top: 15px;
    font-size: 1rem;
    line-height: 1.5;
}

.prompt-text, .layout-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.overlay-text-display {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #fff, var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

.color-palette-display {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.color-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.2s ease;
}

.color-box:hover {
    transform: scale(1.1);
}

.color-code {
    font-size: 0.85rem;
    font-family: monospace;
    color: var(--text-muted);
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

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

footer {
    text-align: center;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    header h1 { font-size: 2.2rem; }
    .glass-card { padding: 20px; }
}
