/* Color Variables */
:root {
    --coral: #ff6b6b;
    --teal: #4ecdc4;
    --orange: #ffe66d;
    --sage: #a8e6cf;
    --indigo: #2d3436;
    --cream: #fff8e7;
    --white: #ffffff;
    --gray-light: #f3f4f6;
    --gray: #9ca3af;
    --gray-dark: #4b5563;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--cream);
    color: var(--indigo);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 10C8 10 8 4 12 4C12 4 14 6 16 6C18 6 20 4 20 4C24 4 24 10 24 10L24 18C24 22 20 26 16 26C12 26 8 22 8 18L8 10Z' fill='%23ff6b6b'/%3E%3Cpath d='M10 18C10 18 12 20 16 20C20 20 22 18 22 18' stroke='%232d3436' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='14' r='1.5' fill='%232d3436'/%3E%3Ccircle cx='20' cy='14' r='1.5' fill='%232d3436'/%3E%3Cpath d='M16 16L16 18' stroke='%232d3436' stroke-width='1.5'/%3E%3C/svg%3E"), auto;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.handwritten {
    font-family: 'Caveat', cursive;
}

.mono-accent {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

/* Particle Background */
.particle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 230, 109, 0.1) 0%, transparent 50%);
    animation: rotate-slow 60s linear infinite;
}

/* Math Decorations */
.math-decoration {
    position: fixed;
    font-family: 'JetBrains Mono', monospace;
    color: var(--teal);
    opacity: 0.2;
    font-size: 4rem;
    pointer-events: none;
    user-select: none;
}

.top-10 { top: 10%; }
.top-20 { top: 20%; }
.top-1\/3 { top: 33.33%; }
.bottom-20 { bottom: 20%; }
.bottom-32 { bottom: 32%; }
.bottom-1\/3 { bottom: 33.33%; }
.left-20 { left: 20%; }
.left-1\/4 { left: 25%; }
.left-1\/3 { left: 33.33%; }
.right-10 { right: 10%; }
.right-1\/4 { right: 25%; }
.right-1\/3 { right: 33.33%; }

/* Animations */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

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

@keyframes blob-morph {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    50% { border-radius: 30% 70% 70% 30% / 70% 30% 30% 70%; }
    75% { border-radius: 70% 30% 30% 70% / 30% 70% 70% 30%; }
}

@keyframes paw-walk {
    0% { opacity: 0; transform: translateX(0); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateX(100px); }
}

/* Utility Classes */
.gradient-text {
    background: linear-gradient(135deg, var(--coral), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-bg {
    background: linear-gradient(-45deg, #ff6b6b, #4ecdc4, #ffe66d, #a8e6cf);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

.float-element {
    animation: float 6s ease-in-out infinite;
}

.float-element-delayed {
    animation: float 6s ease-in-out infinite;
    animation-delay: 2s;
}

.fibonacci-spiral {
    animation: rotate-slow 20s linear infinite;
}

.blob-shape {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: blob-morph 8s ease-in-out infinite;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    padding: 2rem 0;
    text-align: center;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.5rem;
    color: var(--coral);
}

/* Main Content */
.main-content {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

/* Card Organic */
.card-organic {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid var(--gray-light);
    overflow: hidden;
    margin-bottom: 2rem;
    padding: 2rem;
    transform: rotate(-0.5deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-organic:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: var(--coral);
}

/* Section Title */
.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title .icon {
    font-size: 2.5rem;
}

.section-title .rotating {
    display: inline-block;
    animation: rotate-slow 2s linear infinite;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--teal);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(78,205,196,0.05), rgba(255,107,107,0.05));
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--coral);
    background: linear-gradient(135deg, rgba(255,107,107,0.1), rgba(78,205,196,0.1));
    transform: scale(1.02);
}

.upload-area.dragging {
    border-color: var(--orange);
    background: linear-gradient(135deg, rgba(255,230,109,0.2), rgba(168,230,207,0.2));
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--indigo);
}

.upload-content p {
    color: var(--gray-dark);
    margin-bottom: 1.5rem;
}

/* File List */
.file-list {
    margin-top: 1.5rem;
    display: grid;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: linear-gradient(135deg, rgba(78,205,196,0.1), rgba(255,107,107,0.1));
    transform: translateX(5px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 1.5rem;
}

.file-name {
    font-weight: 500;
    color: var(--indigo);
}

.file-size {
    color: var(--gray-dark);
    font-size: 0.875rem;
}

.remove-file {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.remove-file:hover {
    transform: rotate(90deg);
}

/* Configuration */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.config-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--indigo);
}

.model-select,
.lang-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    background: var(--white);
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.model-select:hover,
.lang-select:hover {
    border-color: var(--teal);
}

.model-select:focus,
.lang-select:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255,107,107,0.2);
}

/* Buttons */
.btn-vibrant {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    color: var(--white);
    background: linear-gradient(135deg, var(--coral), var(--teal));
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-vibrant:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255,107,107,0.3);
}

.btn-vibrant:active {
    transform: translateY(0);
}

.btn-vibrant span {
    position: relative;
    z-index: 1;
}

.btn-vibrant::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--orange), var(--sage));
    transition: left 0.3s ease;
}

.btn-vibrant:hover::before {
    left: 0;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-outline-vibrant {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid transparent;
    background: linear-gradient(var(--white), var(--white)) padding-box,
                linear-gradient(135deg, var(--coral), var(--teal)) border-box;
    color: var(--indigo);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-outline-vibrant:hover {
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: var(--white);
    transform: translateY(-2px);
}

/* Progress Section */
.current-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: 12px;
}

.current-file .label {
    font-weight: 600;
    color: var(--gray-dark);
}

.current-file .filename {
    color: var(--indigo);
    font-family: 'JetBrains Mono', monospace;
}

.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 30px;
    background: var(--gray-light);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0;
    transition: width 0.5s ease;
    border-radius: 50px;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--indigo);
}

.progress-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.cat-animation {
    font-size: 3rem;
    animation: float 2s ease-in-out infinite;
}

.paw-prints {
    display: flex;
    gap: 0.5rem;
}

.paw {
    font-size: 1.5rem;
    animation: paw-walk 3s ease-in-out infinite;
}

.paw:nth-child(2) {
    animation-delay: 0.3s;
}

.paw:nth-child(3) {
    animation-delay: 0.6s;
}

/* Results Section */
.success-message {
    text-align: center;
    margin-bottom: 2rem;
}

.success-icon {
    display: inline-block;
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--sage), var(--teal));
    padding: 1rem;
}

.translated-files {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.translated-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(168,230,207,0.1), rgba(78,205,196,0.1));
    border-radius: 12px;
    border: 2px solid var(--sage);
}

.translated-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.download-btn {
    padding: 0.5rem 1rem;
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: var(--coral);
    transform: scale(1.05);
}

.download-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Email Configuration Section */
.email-config-section {
    margin: 2rem 0 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 16px;
}

.email-config-section label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--indigo);
    font-size: 1rem;
}

.email-config-section .email-input {
    width: 100%;
    max-width: 400px;
}

.email-hint {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Email Section (legacy) */
.email-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 16px;
}

.email-section p {
    margin-bottom: 1rem;
    color: var(--indigo);
}

.email-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.email-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 50px;
    background: var(--white);
    transition: border-color 0.3s ease;
}

.email-input:focus {
    outline: none;
    border-color: var(--indigo);
}

.email-status {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    min-height: 1.5rem;
}

/* Error Section */
.error-message {
    color: var(--coral);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,107,107,0.1);
    border-radius: 12px;
    border-left: 4px solid var(--coral);
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    background: var(--white);
    border-top: 2px solid var(--gray-light);
}

.heart {
    color: var(--coral);
    animation: float 2s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    
    .math-decoration {
        display: none;
    }
    
    .card-organic {
        transform: none;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 2rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
}