:root {
    --primary-color: #5B21B6;
    --primary-hover-color: #4C1D95;
    --primary-light: #EDE9FE;
    --secondary-color: #64748B;
    --background-color: #F8FAFC;
    --surface-color: #ffffff;
    --text-color: #0F172A;
    --text-light-color: #64748B;
    --border-color: #E2E8F0;
    --success-color: #059669;
    --error-color: #DC2626;
    --warning-color: #F59E0B;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Background & Surface Colors */
    --background-color: #F8FAFC;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --surface-color: #ffffff;
    --surface-secondary: #F1F5F9;
    --glass-background: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    
    /* Text Colors */
    --text-color: #0F172A;
    --text-light-color: #64748B;
    --text-muted: #94A3B8;
    --text-inverse: #ffffff;
    
    
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-color: rgba(15, 23, 42, 0.1);
    
    
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-colored: 0 20px 25px -5px rgba(99, 102, 241, 0.1), 0 10px 10px -5px rgba(99, 102, 241, 0.04);
    
    /* Animation Timing */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.25s ease-out;
    --transition-slow: 0.4s ease-out;
    
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.1), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(16, 185, 129, 0.08), transparent 50%),
        radial-gradient(ellipse at center, rgba(245, 158, 11, 0.05), transparent 70%);
}

.hidden { display: none !important; }

/* Animated Background Elements */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}


.site-header {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 500;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.logo-background {
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.logo-background .material-icons {
    color: var(--primary-color);
    transition: var(--transition-normal);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-light);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition-normal);
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-main {
    font-size: 1.75rem; 
    font-weight: 700;
}

.logo-sub {
    font-size: 0.95rem;
    font-weight: 400;
    margin-top: -5px; 
}

.logo:hover .logo-background {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.logo:hover .logo-background .material-icons {
    transform: rotate(5deg);
}

.header-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-inverse);
    text-decoration: none;
    transition: var(--transition-normal);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.header-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--glass-background), var(--success-color));
    opacity: 0;
    transition: var(--transition-normal);
    z-index: -1;
}

.header-nav a:hover {
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.header-nav a:hover::before {
    opacity: 1;
}

/* Page Layout */
.page-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 2rem 0 1.5rem;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-light), #DDD6FE);
    color: var(--primary-color);
    padding: 0.375rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(91, 33, 182, 0.2);
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .hero-subheading {
    max-width: 500px;
    margin: 0 auto 1.5rem auto;
    color: var(--text-light-color);
    font-size: 1.05rem;
    font-weight: 400;
}

.trust-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light-color);
}

.trust-badge .material-icons { 
    font-size: 20px;
    color: var(--success-color); 
}

/* Main Container */
.container {
    width: 100%;
    max-width: 950px;
    background: var(--glass-background);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    position: relative;
    margin: 2rem auto 4rem;
    border: 1px solid var(--glass-border);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color), var(--accent-color), var(--info-color));
    background-size: 400% 100%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}


.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    flex-direction: column;
    gap: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--success-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

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

#loader-text {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

#progress-bar {
    width: 250px;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#progress-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
}

#progress-bar-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Dialog Overlays */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(8px);
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

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

.dialog-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
    width: auto;
    height: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    margin: 1rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-50px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-light-color);
    border: 2px solid var(--border-color);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.dialog-close:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

/* View Dialog Specific Styles */
#viewDialog .dialog-content {
    gap: 1rem;
    width: min(90vw, 800px);
    height: min(90vh, 600px);
    padding: 1.5rem;
}

.view-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    border-radius: 8px;
    position: relative;
}

#viewDialogImage {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* Crop Dialog Specific Styles */
#cropDialog .dialog-content {
    gap: 1rem;
    width: min(90vw, 800px);
    height: min(90vh, 600px);
    padding: 1.5rem;
}

#cropDialogBody {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    border-radius: 8px;
    position: relative;
}

#cropDialogImage {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Cropper.js specific styles omitted for brevity */

#cropDialogFooter {
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-shrink: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Main Content Area */
.main-content {
    padding: 2rem;
}


.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    cursor: pointer;
    transition: var(--transition-normal);
    background: linear-gradient(135deg, var(--surface-color), var(--surface-secondary));
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(16, 185, 129, 0.05));
    opacity: 0;
    transition: var(--transition-normal);
}

.drop-zone:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-colored);
}

.drop-zone:hover::before {
    opacity: 1;
}

.drop-zone.drag-over {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.drop-zone .upload-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.drop-zone-subtext {
    color: var(--text-light-color);
    font-size: 0.85rem;
}

#fileInput { display: none; }

/* Buttons */
.btn {
    font-family: inherit;
    padding: 0.625rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn:hover::before {
    transform: translateX(0);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.25);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(91, 33, 182, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1.5px solid var(--border-color);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #047857);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #D97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* Editor Section */
#editorSection {
    padding-top: 0;
}

.editor h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sub-heading {
    text-align: center;
    color: var(--text-light-color);
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 500;
}

.sub-heading b {
    color: var(--primary-color);
    font-weight: 700;
}

/* Preview Areas */
.preview-area {
    position: relative;
    margin-bottom: 2rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--surface-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

#imagePreviewContainer {
    width: 100%;
    max-height: 250px;
}

#imagePreview {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

#imagePreview:hover {
    transform: scale(1.02);
}

.multi-frame-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
}

.multi-frame-preview-container::-webkit-scrollbar {
    width: 10px;
}

.multi-frame-preview-container::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

.multi-frame-preview-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    border-radius: var(--radius-full);
}

.frame {
    border: 3px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    padding-bottom: 100%;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.frame:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.frame.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.frame.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.frame img, .frame canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frame-number {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.frame-view-icon,
.frame-crop-icon {
    position: absolute;
    bottom: 6px;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition-normal);
    font-size: 14px;
    box-shadow: var(--shadow-md);
}

.frame-view-icon:hover,
.frame-crop-icon:hover {
    background: var(--primary-color);
    transform: scale(1.2);
    box-shadow: var(--shadow-lg);
}

.frame-view-icon { right: 6px; }
.frame-crop-icon { right: 40px; }

/* Controls */
.controls,
.gif-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--border-color);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
    transition: var(--transition-normal);
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0.1);
}

.control-group input[type="number"],
.control-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    background: var(--surface-color);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-xs);
}

.control-group input[type="number"]:focus,
.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.control-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236366F1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
    cursor: pointer;
}

.control-group select:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

#qualityInfo {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 700;
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    text-align: center;
    box-shadow: var(--shadow-xs);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--surface-color), var(--surface-secondary));
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
}

/* Result Section */
.result h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
    background: linear-gradient(135deg, var(--success-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-preview {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
}

.result-preview img {
    max-width: 100%;
    max-height: 350px;
    border: 3px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transition: var(--transition-normal);
}

.result-preview img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.result-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.reset-area {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
}

/* Features Section */
.features-section {
    padding: 6rem 0;
    text-align: center;
    position: relative;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.feature-card {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-light);
    text-align: left;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color), var(--accent-color));
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02), rgba(16, 185, 129, 0.02));
    opacity: 0;
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-color);
}

.feature-card:hover::before {
    transform: translateX(0);
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-light), rgba(16, 185, 129, 0.1));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-lg);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--text-light-color);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Full-Width Footer */
.main-footer {
    width: 100%;
    background-color: var(--surface-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light-color);
}

.footer-content p {
    margin-bottom: 0.25rem;
}

.footer-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-content a:hover {
    text-decoration: underline;
}


.site-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default for mobile */
    justify-content: center;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    position: relative;
}





/* Responsive Design */
@media (max-width: 768px) {
    .page-wrapper,
    .header-content,
    .footer-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }
    
    .trust-badges {
        gap: 1rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .drop-zone {
        padding: 2rem 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}