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

body {
    font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(120deg, #e0e7ff 0%, #f8fafc 100%);
    color: #222c3a;
    padding: 32px 0 0 0;
    box-shadow: 0 4px 32px 0 rgba(60, 80, 120, 0.08);
    transition: background 0.5s, color 0.3s;
    letter-spacing: 0.02em;
    font-size: 1.08rem;
    line-height: 1.7;
    backdrop-filter: blur(2px);
}


.app {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8faff 0%, #e6f2ff 50%, #dde7f7 100%);
    position: relative;
}

/* Animated Background Elements */
.background-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.bg-element {
    position: absolute;
    border-radius: 50%;
    blur: 60px;
    animation: float 6s ease-in-out infinite;
}

.bg-element-1 {
    top: -200px;
    right: -200px;
    width: 320px;
    height: 320px;
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    animation-delay: 0s;
}

.bg-element-2 {
    bottom: -200px;
    left: -200px;
    width: 320px;
    height: 320px;
    background: linear-gradient(45deg, rgba(34, 197, 94, 0.15), rgba(59, 130, 246, 0.15));
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(2deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

/* Container */
.container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo-icon {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

.logo-icon i {
    font-size: 2rem;
    color: #6366f1;
}

.logo-text {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
    background-size: 300% 300%;
}

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

.subtitle {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Glass Card Base */
.glass-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 48px rgba(31, 38, 135, 0.25);
    transform: translateY(-2px);
}

/* Left Panel */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Upload Card */
.upload-card {
    padding: 2rem;
}

.upload-area {
    border: 2px dashed #a5b4fc;
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.upload-area:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.dragover {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.upload-icon i {
    font-size: 4rem;
    color: #6366f1;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -15px, 0);
    }
    70% {
        transform: translate3d(0, -7px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.upload-area h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #64748b;
    margin-bottom: 1rem;
}

.format-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Settings Card */
.settings-card {
    padding: 1.5rem;
}

/* Tabs */
.tab-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.75rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.tab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

/* Custom Select */
.select-wrapper {
    position: relative;
}

.custom-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #1e293b;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

/* Custom Slider */
.slider-wrapper {
    position: relative;
}

.custom-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.custom-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.custom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Switch */
.switch-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch-label {
    font-weight: 500;
    color: #1e293b;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.3);
    transition: 0.4s;
    border-radius: 24px;
}

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

.switch input:checked + .switch-slider {
    background-color: #6366f1;
}

.switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* Convert Button */
.convert-section {
    display: flex;
    justify-content: center;
}

.convert-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.convert-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #5856eb, #7c3aed);
}

.convert-btn:active {
    transform: translateY(0) scale(0.95);
}

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

.convert-btn .fa-spin {
    animation: spin 1s linear infinite;
}

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

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card Headers */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-left i {
    color: #6366f1;
}

.header-left h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.file-count {
    padding: 0.25rem 0.75rem;
    background: rgba(148, 163, 184, 0.2);
    color: #64748b;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.success-count {
    background: rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

/* Queue Card */
.queue-card {
    padding: 1.5rem;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.7);
}

.file-preview {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: #64748b;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-status {
    color: #16a34a;
}

.remove-btn {
    padding: 0.25rem;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 0.25rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.file-item:hover .remove-btn {
    opacity: 1;
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Results Card */
.results-card {
    padding: 1.5rem;
}

.converted-list {
    max-height: 300px;
    overflow-y: auto;
}

.converted-item {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.converted-item:hover {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

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

.converted-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #1e293b;
}

.format-badge {
    padding: 0.125rem 0.5rem;
    background: #16a34a;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.size-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, #16a34a, #06b6d4);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

/* Progress Card */
.progress-card {
    padding: 1.5rem;
}

.progress-wrapper {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    min-width: 300px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.toast-icon {
    margin-top: 0.125rem;
    font-size: 1.25rem;
}

.toast.success .toast-icon {
    color: #16a34a;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.toast-description {
    font-size: 0.875rem;
    color: #64748b;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -4px 32px rgba(31, 38, 135, 0.1);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-left .logo-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
}

.footer-left .logo-icon i {
    font-size: 1.5rem;
    color: #6366f1;
}

.footer-left .logo-icon h3 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.footer-left p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.footer-right {
    display: flex;
    gap: 1rem;
}

.footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #1e293b;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.footer-link:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}


/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .tab-list {
        font-size: 0.875rem;
    }
    
    .convert-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .toast {
        right: 0.5rem;
        left: 0.5rem;
        min-width: auto;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-left {
        justify-content: center;
        gap: 0.5rem;
    }

    .footer-right {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .format-badges {
        gap: 0.25rem;
    }
    
    .tab-list {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}