:root {
    --primary: #00f2fe;
    --primary-glow: rgba(0, 242, 254, 0.5);
    --secondary: #4facfe;
    --accent: #ff0080;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.8);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Animated Background */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    opacity: 0.25;
    filter: blur(80px);
}

.blob-1 {
    background: var(--primary);
    top: -10%;
    left: -10%;
    animation: lava-1 25s infinite alternate ease-in-out;
}

.blob-2 {
    background: var(--accent);
    bottom: -10%;
    right: -10%;
    animation: lava-2 30s infinite alternate ease-in-out;
}

.blob-3 {
    background: var(--secondary);
    top: 40%;
    left: 30%;
    animation: lava-3 35s infinite alternate ease-in-out;
}

@keyframes lava-1 {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20vw, 10vh) scale(1.2); }
    66% { transform: translate(-10vw, 20vh) scale(0.8); }
    100% { transform: translate(10vw, -10vh) scale(1.1); }
}

@keyframes lava-2 {
    0% { transform: translate(0, 0) scale(1.1); }
    50% { transform: translate(-25vw, -15vh) scale(0.9); }
    100% { transform: translate(5vw, 10vh) scale(1.2); }
}

@keyframes lava-3 {
    0% { transform: translate(0, 0) scale(0.9); }
    25% { transform: translate(15vw, -20vh) scale(1.1); }
    75% { transform: translate(-15vw, 15vh) scale(1.3); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Container */
.container {
    width: 90%;
    max-width: 800px;
    text-align: center;
    padding: 2rem 0;
}

header {
    margin-bottom: 3rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

h1.glitch {
    position: relative;
    cursor: default;
    transition: transform 0.3s ease;
}

h1.glitch:hover {
    transform: skewX(-5deg) rotate(-1deg);
}

h1.glitch::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--primary);
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    white-space: nowrap;
    text-shadow: 0 0 15px var(--primary-glow);
    pointer-events: none;
    transform: translateX(0) skewX(0);
}

h1.glitch:hover::before {
    opacity: 0.5;
    transform: translateX(30px) skewX(-15deg);
}

/* App Card */
.app-card {
    position: relative;
    perspective: 1000px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    min-height: 450px;
    display: grid;
    grid-template-areas: "content";
    align-items: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.drop-zone, .processing-view, .success-view {
    grid-area: content;
    width: 100%;
    z-index: 1;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 3rem;
    cursor: pointer;
    transition: all 0.3s ease, transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s ease;
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    transform-origin: left center;
    z-index: 2; /* Ensure it's above the processing view initially */
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(0, 242, 254, 0.05);
    transform: scale(1.01);
}

.peeling-active .drop-zone {
    transform: rotateY(-110deg) translateX(-20%);
    opacity: 0;
    pointer-events: none;
}


.icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.icon-video {
    width: 40px;
    height: 40px;
}

.drop-zone h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: #000;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-secondary {
    position: relative;
    z-index: 5;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-ghost:hover {
    color: #fff;
}

/* Processing View */
.processing-view {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.grinder-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 1rem;
}

/* The Machine / Gears */
.machine {
    position: relative;
    width: 120px;
    height: 120px;
}

.gear {
    position: absolute;
    background: var(--text-muted);
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 15a3 3 0 100-6 3 3 0 000 6z'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    animation: rotate 4s linear infinite;
}

.gear-1 { width: 60px; height: 60px; top: 0; left: 0; background: var(--primary); }
.gear-2 { width: 45px; height: 45px; bottom: 5px; left: 55px; background: var(--secondary); animation-direction: reverse; animation-duration: 3s; }
.gear-3 { width: 35px; height: 35px; top: 35px; left: 50px; background: var(--accent); animation-duration: 2s; }

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Waveform Output */
.waveform-output {
    flex-grow: 1;
    height: 100px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    overflow: hidden;
    position: relative;
}

.waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
    height: 60%;
}

.wave-bar {
    width: 4px;
    background: var(--primary);
    border-radius: 2px;
    animation: bar-pulse 1s ease-in-out infinite;
    transform-origin: center;
}

@keyframes bar-pulse {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* Progress Section */
.progress-info {
    text-align: left;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.3s ease;
}

.console-output {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    height: 40px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.7;
}

/* Success View */
.success-view {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.success-icon svg { width: 40px; height: 40px; }

.actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

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

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* Responsive */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .app-card { padding: 1.5rem; }
    .grinder-container { flex-direction: column; gap: 1.5rem; }
}
