/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #22D3EE;
    --accent: #A78BFA;
    --surface: #FFFFFF;
    --background: #F8FAFC;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 70px;
    --fab-size: 64px;
}

html[dir="rtl"] {
    text-align: right;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    max-width: 100vw;
    overflow-x: hidden;
    padding-bottom: calc(var(--nav-height) + 20px);
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Layout */
.app-header {
    padding: 20px 24px 12px;
    position: relative;
}

.header-content {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.8;
}

.main-content {
    padding: 0 20px 100px;
    max-width: 800px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-header i {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(79, 70, 229, 0.02);
}

.upload-area:hover, .upload-area:active {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 16px;
    opacity: 0.7;
}

.upload-sub {
    font-size: 0.85rem;
    margin-top: 8px;
    opacity: 0.7;
}

.hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(34, 211, 238, 0.1);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.hint i {
    color: var(--secondary);
}

/* Image Preview */
.image-preview-container {
    position: relative;
    margin-bottom: 24px;
}

.before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--border);
    height: 250px;
}

.image-wrapper {
    position: relative;
    background: #000;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.image-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-container input {
    pointer-events: auto;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: col-resize;
}

.slider-icon {
    position: absolute;
    width: 48px;
    height: 48px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--primary);
    pointer-events: none;
}

/* Controls */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

select, input[type="range"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

select:focus, input[type="range"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 18px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    min-height: 56px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

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

.btn-secondary:hover, .btn-secondary:active {
    border-color: var(--primary);
    color: var(--primary);
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.processing-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--card-shadow);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

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

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 24px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Results */
.results-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(34, 211, 238, 0.05);
    padding: 16px;
    border-radius: var(--radius-md);
}

.info-item i {
    font-size: 1.2rem;
    color: var(--secondary);
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.info-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.feature-card {
    background: var(--surface);
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 1.5rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 0 20px;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
    padding: 8px 0;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover, .nav-item:active {
    color: var(--primary);
}

/* FAB */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 24px;
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
    transition: var(--transition);
    z-index: 99;
}

.fab:hover, .fab:active {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.4);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

html[dir="rtl"] .lang-switcher {
    right: auto;
    left: 24px;
}

.lang-switcher select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

html[dir="rtl"] .lang-switcher select {
    background-position: left 10px center;
}

.lang-switcher i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Additional styles for about, privacy, and contact pages */
.about-features {
    margin-top: 24px;
}

.about-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(79, 70, 229, 0.05);
    border-radius: var(--radius-md);
}

.about-feature i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 4px;
}

.tech-list, .privacy-list {
    padding-left: 20px;
    margin: 16px 0;
}

.tech-list li, .privacy-list li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.privacy-point {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-sm);
}

.privacy-point i {
    color: var(--success);
    font-size: 1.2rem;
}

.contact-methods {
    margin-top: 24px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

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

.contact-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    margin-bottom: 4px;
}

.contact-info p {
    margin-bottom: 2px;
    color: var(--text-primary);
    font-weight: 500;
}

.contact-info small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.contact-card .fa-chevron-right {
    color: var(--text-secondary);
}

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* RTL adjustments */
html[dir="rtl"] .tech-list,
html[dir="rtl"] .privacy-list {
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] .contact-card .fa-chevron-right {
    transform: rotate(180deg);
}

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

/* Responsive */
@media (max-width: 480px) {
    .main-content {
        padding: 0 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .results-info {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .before-after {
        height: 200px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --surface: #1E293B;
        --background: #0F172A;
        --text-primary: #F1F5F9;
        --text-secondary: #94A3B8;
        --border: #334155;
    }
    
    .processing-overlay {
        background: rgba(15, 23, 42, 0.95);
    }
    
    .bottom-nav {
        background: rgba(30, 41, 59, 0.9);
        border-top-color: var(--border);
    }
    
    .about-feature {
        background: rgba(79, 70, 229, 0.1);
    }
    
    .privacy-point {
        background: rgba(16, 185, 129, 0.15);
    }
    
    .contact-card {
        background: var(--surface);
    }
    
    .faq-item {
        border-bottom-color: var(--border);
    }
}
/* ===== Contact Page Specific Styles ===== */

/* Developer Info Styles */
.developer-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(79, 70, 229, 0.05);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.dev-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}

.dev-details {
    flex: 1;
}

.dev-details h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: var(--primary);
}

.dev-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dev-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* FAQ Improvements */
.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.faq-item:hover {
    background: rgba(79, 70, 229, 0.02);
    padding-left: 12px;
    padding-right: 12px;
    border-radius: var(--radius-sm);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-item h3::before {
    content: "•";
    color: var(--primary);
    font-size: 1.5rem;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Social Media Icons */
.fa-vk, .fa-instagram {
    font-size: 1.5rem;
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    .developer-info {
        background: rgba(79, 70, 229, 0.1);
    }
    
    .faq-item:hover {
        background: rgba(79, 70, 229, 0.05);
    }
}

/* RTL Support */
html[dir="rtl"] .faq-item:hover {
    padding-left: 12px;
    padding-right: 12px;
}

html[dir="rtl"] .faq-item h3::before {
    content: "•";
    margin-left: 8px;
    margin-right: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .developer-info {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .dev-details h3 {
        font-size: 1.3rem;
    }
}