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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

.main-content {
    padding: 30px;
}

.control-panel {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4b5563;
    font-size: 1.1rem;
}

.path-input {
    display: flex;
    gap: 10px;
}

.path-input input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.path-input input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4b5563;
}

.filter-item input[type="number"] {
    width: 120px;
    padding: 10px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.filter-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.file-formats-container {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.formats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.formats-header h3 {
    color: #4b5563;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.format-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.category-tab {
    padding: 10px 20px;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tab.active {
    background: #4f46e5;
    color: white;
}

.category-tab:hover:not(.active) {
    background: #cbd5e1;
}

.format-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.format-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.format-item:hover {
    background: #f0f9ff;
    border-color: #93c5fd;
}

.format-item label {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #475569;
}

.format-count {
    background: #e2e8f0;
    color: #4b5563;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.quick-select-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.quick-select-btn {
    padding: 8px 16px;
    background: #e2e8f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-select-btn:hover {
    background: #cbd5e1;
}

.quick-select-btn.select-all {
    background: #dbeafe;
    color: #1d4ed8;
}

.quick-select-btn.deselect-all {
    background: #fee2e2;
    color: #dc2626;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-warning {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

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

.btn-secondary {
    background: #e2e8f0;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #cbd5e1;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.progress-container {
    flex: 1;
    min-width: 200px;
    margin-top: 20px;
}

.progress-bar {
    height: 10px;
    background: #cbd5e1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 5px;
    transition: width 0.3s ease;
}

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

.results-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
}

.tab-btn {
    padding: 18px 30px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn.active {
    color: #4f46e5;
    background: white;
    border-top: 3px solid #4f46e5;
}

.tab-btn:hover:not(.active) {
    color: #4f46e5;
    background: #e2e8f0;
}

.badge {
    background: #ef4444;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    min-width: 25px;
    text-align: center;
}

.tab-content {
    padding: 20px;
    min-height: 500px;
    max-height: 600px;
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

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

.tree-container, .duplicates-container, .stats-container, .excluded-dirs-view {
    background: white;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.empty-state i {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
}

/* Tree styling - ÒÎËÜÊÎ ÏÀÏÊÈ */
.tree-view {
    padding: 15px;
}

.tree-item {
    margin: 5px 0;
    padding-left: 20px;
    position: relative;
}

.tree-folder {
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.tree-folder:hover {
    background: #e2e8f0;
    transform: translateX(5px);
}

.tree-folder .folder-actions {
    margin-left: auto;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tree-folder:hover .folder-actions {
    opacity: 1;
}

.folder-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.folder-btn.exclude {
    color: #dc2626;
}

.folder-btn.exclude:hover {
    background: #fee2e2;
}

.folder-btn.include {
    color: #10b981;
}

.folder-btn.include:hover {
    background: #d1fae5;
}

.folder-file-count {
    background: #e2e8f0;
    color: #4b5563;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 10px;
}

/* Duplicates styling */
.duplicate-group {
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.duplicate-header {
    background: #e2e8f0;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    color: #4b5563;
}

.duplicate-items {
    padding: 15px;
}

.duplicate-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.duplicate-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.duplicate-item.selected {
    border-color: #4f46e5;
    background: #eff6ff;
}

.file-path {
    flex: 1;
    font-family: monospace;
    color: #475569;
}

.file-size {
    color: #64748b;
    font-weight: 500;
}

.file-modified {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Stats styling */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #cbd5e1;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 10px;
}

.stat-label {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Excluded directories view */
.excluded-dirs-container {
    padding: 20px;
}

.excluded-dir-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #fef2f2;
    border-radius: 10px;
    border: 2px solid #fecaca;
}

.excluded-dir-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.excluded-dir-path {
    font-family: monospace;
    color: #dc2626;
    font-weight: 500;
}

.excluded-dir-stats {
    font-size: 0.9rem;
    color: #ef4444;
    background: #fee2e2;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Modal styling */
.comparison-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.comparison-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.comparison-files {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.comparison-file {
    background: #f8fafc;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.comparison-file h3 {
    color: #4f46e5;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-details {
    display: grid;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-label {
    color: #64748b;
    font-weight: 500;
}

.detail-value {
    color: #1e293b;
    font-weight: 600;
}

.detail-value.path {
    font-family: monospace;
    font-size: 0.9rem;
    color: #475569;
}

.file-preview {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    max-height: 200px;
    overflow-y: auto;
}

.preview-placeholder {
    color: #94a3b8;
    text-align: center;
    padding: 40px 20px;
}

/* Footer */
footer {
    background: #f8fafc;
    padding: 25px 40px;
    text-align: center;
    border-top: 2px solid #e2e8f0;
    color: #64748b;
}

footer .hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Notification styles */
.notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: #10b981 !important;
    color: white !important;
    padding: 15px 20px !important;
    border-radius: 10px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    min-width: 300px !important;
    max-width: 500px !important;
    animation: slideIn 0.3s ease !important;
    white-space: pre-line !important;
}

.notification-error {
    background: #ef4444 !important;
}

.notification-warning {
    background: #f59e0b !important;
}

.notification-info {
    background: #3b82f6 !important;
}

.close-notification {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    margin-left: auto !important;
}

.close-notification:hover {
    opacity: 0.8 !important;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Styles for files marked for deletion */
.duplicate-item.marked-for-delete {
    background: #fee2e2 !important;
    border-left: 4px solid #dc2626 !important;
    opacity: 0.8;
}

/* Delete list styles */
.delete-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.delete-list-item .file-path {
    flex: 1;
    font-family: monospace;
    color: #475569;
    word-break: break-all;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.delete-list-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 10px;
}

.delete-list-container {
    max-height: 400px;
    overflow-y: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .path-input {
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: center;
        padding: 15px;
    }
    
    .comparison-files {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    .delete-list-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .delete-list-info button {
        width: 100%;
    }
    
    .format-checkboxes {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .format-categories {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .excluded-dir-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Format icon colors */
.format-icon.video { color: #ef4444; }
.format-icon.audio { color: #3b82f6; }
.format-icon.image { color: #10b981; }
.format-icon.document { color: #8b5cf6; }
.format-icon.archive { color: #f59e0b; }
.format-icon.program { color: #ec4899; }
.format-icon.web { color: #06b6d4; }

/* Mode indicator */
.mode-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #dbeafe;
    border-radius: 20px;
    font-weight: 600;
    color: #1d4ed8;
    margin-top: 10px;
}

.mode-indicator.scanning {
    background: #fef3c7;
    color: #d97706;
}

.mode-indicator.analyzing {
    background: #d1fae5;
    color: #059669;
}