:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.2);
    --accent-glow: #7928CA;
    --accent-liquid-1: #7928CA;
    --accent-liquid-2: #FF0080;
    --accent-liquid-3: #0070F3;
    --accent-liquid-4: #F5A623;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    /* Enable Scroll */
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content horizontally */
    padding-bottom: 50px;
    /* Space at bottom */
}

/* --- Liquid Mesh Background --- */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 15% 50%, rgba(121, 40, 202, 0.25), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 0, 128, 0.25), transparent 25%);
    filter: blur(40px);
}

.blob {
    position: absolute;
    width: 60vw;
    height: 60vw;
    background: linear-gradient(180deg, var(--accent-liquid-3) 0%, var(--accent-liquid-1) 100%);
    contain: layout paint;
    mix-blend-mode: hard-light;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    filter: blur(60px);
    opacity: 0.4;
    animation: flow 20s infinite linear;
}

.blob-1 {
    top: -10%;
    left: -10%;
    animation-duration: 25s;
    background: var(--accent-liquid-3);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    animation-duration: 30s;
    animation-direction: reverse;
    background: var(--accent-liquid-2);
}

@keyframes flow {
    0% {
        transform: rotate(0deg) scale(1);
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    33% {
        transform: rotate(120deg) scale(1.1);
        border-radius: 50% 50% 20% 80% / 25% 80% 20% 75%;
    }

    66% {
        transform: rotate(240deg) scale(0.9);
        border-radius: 60% 40% 30% 70% / 70% 30% 70% 30%;
    }

    100% {
        transform: rotate(360deg) scale(1);
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

/* --- Navigation (Removed) --- */

/* --- Container --- */
/* --- Container --- */
.container {
    width: 60%;
    /* 20% margin on each side */
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 2rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    bottom: 100px;
    /* Moved up to avoid Heart Button */
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ... existing toast styles ... */

/* --- Like Feature --- */
.floating-heart-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF0080 0%, #7928CA 100%);
    border: none;
    box-shadow: 0 10px 25px rgba(255, 0, 128, 0.4);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulseHeart 2s infinite;
}

.floating-heart-btn:hover {
    transform: scale(1.1);
}

.floating-heart-btn:active {
    transform: scale(0.9);
}

@keyframes pulseHeart {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 128, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 0, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 128, 0);
    }
}

.like-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 1rem;
    color: white;
    /* Fallback */
    -webkit-text-fill-color: white;
    /* Override parent gradient */
    margin-left: 15px;
    vertical-align: middle;
    backdrop-filter: blur(5px);
}

.heart-particle {
    position: fixed;
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    z-index: 2000;
}

@keyframes floatUp {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), -100px) scale(0);
        opacity: 0;
    }
}

/* --- View Sections --- */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view-section.active {
    display: block;
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center since back button is gone */
    gap: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.tool-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Generators Layout (Cleaned up, used for Preview Cards) --- */

/* Format Options on Home Page */
.format-options {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping */
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    /* Slightly lighter for visibility */
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.format-option {
    position: relative;
    cursor: pointer;
}

.format-option input {
    display: none;
}

.format-option span {
    display: block;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    /* Slight bg for unselected */
    border: 1px solid transparent;
    transition: 0.3s;
}

.format-option input:checked+span {
    background: white;
    color: black;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Primary Button (Liquid Glow) */
.btn {
    width: auto;
    /* Changed from 100% */
    min-width: 140px;
    /* Ensure decent hit area */
    padding: 0.75rem 1.5rem;
    /* Reduced padding */
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    /* Slightly smaller font */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s var(--ease-elastic);
    position: relative;
    overflow: hidden;
}

.primary-btn {
    background: linear-gradient(90deg, var(--accent-liquid-1), var(--accent-liquid-2));
    color: white;
    box-shadow: 0 10px 30px rgba(121, 40, 202, 0.4);
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    transform: translateX(-100%);
    transition: 0.5s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 0, 128, 0.5);
}

.primary-btn:hover::after {
    transform: translateX(100%);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Preview Cards --- */
.image-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    border: 1px dashed var(--glass-border);
    min-height: 0;
    /* Important for flex child to shrink */
}

.image-container img,
.image-container svg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 1.5rem;
    height: 100%;
    /* min-height removed to allow fitting in screen */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 1rem;
}

.filename-input {
    width: 100%;
    padding: 0.5rem 0.5rem;
    /* Marge haute et basse requested */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.filename-input:focus {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

#image-tool-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.drop-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--glass-border);
    border-radius: 20px;
    margin: 0rem 0rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    transition: 0.3s;
}

.preview-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: 100%;
    overflow: hidden;
}

.tool-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    body {
        overflow-y: auto;
        height: auto;
    }

    .navbar {
        width: 95%;
        max-width: 100%;
        top: 1rem;
    }

    .container {
        width: 95%;
        height: auto;
        overflow: visible;
        padding-bottom: 4rem;
        /* Extra space at bottom */
    }

    #image-tool-view {
        height: auto;
    }

    .preview-area {
        display: flex;
        flex-direction: column-reverse;
        /* Converted top, Original bottom */
        height: auto;
        gap: 2rem;
        overflow: visible;
    }

    .preview-card {
        min-height: 500px;
        /* Ensure visibility when stacked */
        height: auto;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Main App Global Title */
.app-title {
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.1));
}

@media (max-width: 768px) {
    .app-title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    .preview-card {
        min-height: auto !important;
        height: auto !important;
        padding: 1rem;
    }

    .preview-area {
        gap: 1rem;
    }

    /* Adjust main padding */
    .container {
        padding: 1rem;
    }
}
/* Tuto Accordion Styles */
.tuto-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tuto-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.tuto-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.tuto-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    font-weight: 500;
}

.tuto-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.tuto-card.expanded .tuto-icon {
    transform: rotate(180deg);
}

.tuto-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.4s ease;
    padding: 0 1.5rem;
}

.tuto-card.expanded .tuto-content {
    max-height: 1000px;
    opacity: 1;
    padding-bottom: 1.5rem;
    transition: max-height 0.4s ease-in-out, opacity 0.4s ease;
}

.tuto-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #cbd5e0;
}
