* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
    color: #e0e0e0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #1e1e2e;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
    border: 1px solid #2d2d3e;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    color: #e0e0e0;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #b0b0b0;
    font-size: 1.1em;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #252538;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: #8b9aff;
    background: #2d2d45;
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: #8b9aff;
    background: #353550;
    transform: scale(1.05);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.3em;
    color: #e0e0e0;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-hint {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 20px;
}

#fileInput {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.7);
}

.upload-btn:active {
    transform: translateY(0);
}

.files-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #252538;
    border-radius: 10px;
    border: 1px solid #2d2d3e;
}

.select-all-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #e0e0e0;
    font-weight: 600;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.selected-count {
    color: #b0b0b0;
    font-size: 0.9em;
}

.file-item {
    background: #252538;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
    border: 2px solid #2d2d3e;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #2d2d45;
    border-color: #3d3d55;
}

.file-item.selected {
    background: #2d3d55;
    border-color: #667eea;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-left: 15px;
    border: 2px solid #3d3d55;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 5px;
    word-break: break-all;
}

.file-size {
    color: #b0b0b0;
    font-size: 0.9em;
}

.file-status {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.status-pending {
    background: #4a3d1f;
    color: #ffd700;
}

.status-converting {
    background: #1e3a5f;
    color: #6bb6ff;
}

.status-success {
    background: #1e4d2e;
    color: #4ade80;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.convert-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.7);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.convert-all-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.5);
}

.convert-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.7);
}

.convert-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.clear-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.clear-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #2d2d3e;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #3d3d55;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    text-align: center;
    color: #b0b0b0;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-info {
        width: 100%;
        margin-bottom: 15px;
    }

    .actions {
        flex-direction: column;
    }

    .convert-btn,
    .convert-all-btn,
    .clear-btn {
        width: 100%;
    }
}
