:root {
    --bg-color: #000000;
    --bg-secondary: #111111;
    --text-color: #ffffff;
    --text-secondary: #aaaaaa;
    --primary-color: #bb86fc;
    --primary-dark: #3700b3;
    --secondary-color: #03dac6;
    --accent-color: #ff0266;
    --border-color: #333333;
    --card-bg: #1a1a1a;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
}

[data-theme="light"] {
    --bg-color: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --primary-color: #6200ee;
    --primary-dark: #3700b3;
    --secondary-color: #018786;
    --accent-color: #ff0266;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
}

.logo span {
    font-weight: 300;
}

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

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

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

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

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-container {
    width: 100%;
    max-width: 800px;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
    animation: slideUp 0.5s ease-out;
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dropzone:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(187, 134, 252, 0.2);
}

.dropzone.active {
    border-color: var(--primary-color);
    background-color: rgba(187, 134, 252, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.dropzone:hover .upload-icon {
    transform: scale(1.1);
    color: var(--accent-color);
}

.dropzone h2 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

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

#fileInput {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(187, 134, 252, 0.4);
}

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

.btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn.outline:hover {
    background-color: rgba(187, 134, 252, 0.1);
}

.btn-loader {
    display: none;
}

.btn-loader.hidden {
    display: none;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.result-container {
    width: 100%;
    margin-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.result-container.hidden {
    display: none;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.image-wrapper {
    flex: 1;
    min-width: 300px;
    max-width: 100%;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 400px;
}

.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: 0 5px 15px var(--shadow-color);
    border-left: 5px solid var(--primary-color);
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification.info {
    border-left-color: var(--info-color);
}

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

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .upload-container {
        padding: 1.5rem;
    }
    
    .options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .image-preview {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .dropzone {
        padding: 2rem 1rem;
    }
    
    .dropzone h2 {
        font-size: 1.2rem;
    }
}
/* Enhanced Loading Animation */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(187, 134, 252, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

.loading-spinner.small {
    width: 20px;
    height: 20px;
    border-width: 3px;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

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

/* Pulse animation for text */
.loading-text {
    animation: pulse 1.5s infinite;
    color: var(--primary-color);
}

/* Wave animation for multiple dots */
.wave-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.wave-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: wave 1.2s infinite ease-in-out;
}

.wave-dots span:nth-child(1) {
    animation-delay: 0s;
}
.wave-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.wave-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wave {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    30% {
        transform: translateY(-10px);
        opacity: 0.5;
    }
}
/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    text-align: center;
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}