:root {
    --primary-pink: #ff2a6d;
    --primary-green: #00cc88;
    --secondary-pink: #ff7eb3;
    --secondary-green: #66ffcc;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --dark-pink: #4c0519;
    --dark-green: #052e16;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 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.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --transition: all 0.3s ease;
}

.dark-mode {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --border-color: #4b5563;
}

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

body {
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.logo i {
    margin-right: 0.5rem;
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* Section management */
section {
    display: none;
}

section.active-section {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    flex: 1;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.header-spacer {
    width: 40px;
}

.back-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.back-btn:hover {
    background: var(--border-color);
}

.upload-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-primary);
}

.upload-area:hover {
    border-color: var(--primary-pink);
    background: var(--bg-tertiary);
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-placeholder h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.formats, .max-size {
    font-size: 0.9rem;
}

.section-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.section-nav-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-nav-btn:hover {
    background: var(--border-color);
}

.editor-section {
    margin-top: 2rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.change-photo-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.change-photo-btn:hover {
    background: var(--border-color);
}

.file-info {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.file-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.file-details {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.file-details span:first-child {
    margin-right: auto;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.light-mode .btn-secondary:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
}

.dark-mode .btn-secondary:disabled {
    background-color: #4b5563;
    color: #9ca3af;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.preview-container {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-controls {
    display: flex;
    gap: 1rem;
}

.swipe-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.image-preview {
    width: 100%;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    position: relative;
    touch-action: pan-y;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    color: white;
    font-size: 2rem;
    backdrop-filter: blur(4px);
}

.loading-spinner.hidden {
    display: none;
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.effect-indicator {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.effect-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.effect-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.dot.active {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: var(--transition);
}

.dot.active::after {
    border-color: rgba(255, 255, 255, 0.3);
}

.intensity-control {
    margin: 1.5rem 0;
}

.intensity-control label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#intensitySlider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    transition: var(--transition);
}

#intensitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-green) 100%);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#intensitySlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#intensityInput {
    width: 60px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

.effect-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.btn-toggle.active {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-green) 100%);
    color: white;
    border-color: transparent;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 10px;
    position: relative;
    transition: var(--transition);
}

.light-mode .toggle-switch {
    background: #d1d5db;
}

.dark-mode .toggle-switch {
    background: #6b7280;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.btn-toggle.active .toggle-switch {
    background: rgba(255, 255, 255, 0.5);
}

.btn-toggle.active .toggle-switch::before {
    transform: translateX(16px);
}

.export-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.export-options label {
    font-weight: 500;
    color: var(--text-primary);
}

#exportFormat {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-green) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.footer-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.theme-toggle-container,
.language-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle-container i {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.language-short {
    display: inline;
}

.desktop-only {
    display: none;
}

.theme-switch,
.language-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input,
.language-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    transition: .4s;
    border-radius: 34px;
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider.round {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-green) 100%);
}

input:checked + .slider.round:before {
    transform: translateX(30px);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.footer-info h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-info h3 a:hover {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-info p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-pink);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

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

.developer-link {
    display: inline-block;
    transition: var(--transition);
}

.developer-logo {
    height: 30px;
    width: auto;
    border-radius: 6px;
    transition: var(--transition);
}

.developer-link:hover .developer-logo {
    transform: scale(1.1);
}

.hidden {
    display: none;
}

.dragover {
    border-color: var(--primary-green) !important;
    background-color: rgba(0, 204, 136, 0.1) !important;
}

/* Swipe animation */
.swipe-right {
    animation: swipeRight 0.3s ease;
}

.swipe-left {
    animation: swipeLeft 0.3s ease;
}

@keyframes swipeRight {
    0% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(100%); opacity: 0; }
    51% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes swipeLeft {
    0% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(-100%); opacity: 0; }
    51% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 992px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .preview-controls {
        width: 100%;
        justify-content: center;
    }
    
    .effect-toggles {
        grid-template-columns: 1fr;
    }
    
    .footer-controls {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .export-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 769px) {
    .footer-controls {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
    
    .desktop-only {
        display: inline;
    }
    
    .language-short {
        display: none;
    }
}

@media (max-width: 576px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-placeholder h2 {
        font-size: 1.2rem;
    }
    
    .image-preview {
        height: 300px;
    }
    
    .section-nav {
        flex-direction: row;
        justify-content: center;
    }
    
    .section-nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}