/* MCO Institute File Management System - Professional Styles */

/* ============ RESET & BASE STYLES ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

/* ============ LOADING OVERLAY ============ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ LOGIN SCREEN ============ */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
    margin: 1rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.login-header .logo i {
    font-size: 2.5rem;
    color: #667eea;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
}

.login-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #718096;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f7fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* ============ MAIN APPLICATION ============ */
.main-app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f7fafc;
}

/* ============ HEADER ============ */
.app-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

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

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

.header-left .logo i {
    font-size: 1.75rem;
    color: #667eea;
}

.header-left .logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #718096;
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.user-info i {
    font-size: 1.25rem;
    color: #667eea;
}

.logout-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: #cbd5e0;
    color: #2d3748;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.refresh-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #edf2f7;
    color: #5a67d8;
}

.categories-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.category-item {
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 1rem 0.25rem;
    border-radius: 8px;
}

.category-item:hover {
    background: #edf2f7;
}

.category-item.active {
    background: #667eea;
    color: white;
}

.category-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.file-count {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.category-item.active .file-count {
    background: rgba(255, 255, 255, 0.2);
}

.subcategories {
    margin-left: 1rem;
}

.subcategory .category-content {
    padding-left: 2rem;
    font-size: 0.9rem;
}

/* ============ CONTENT AREA ============ */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ============ TOOLBAR ============ */
.toolbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toolbar-left h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.file-count {
    color: #718096;
    font-size: 0.9rem;
}

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

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

/* ============ UPLOAD AREA ============ */
.upload-area {
    background: white;
    margin: 1.5rem 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: visible;
    min-height: fit-content;
}

.upload-zone {
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed #cbd5e0;
    margin: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f7fafc;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: #718096;
    margin-bottom: 0.5rem;
}

.upload-info {
    font-size: 0.85rem;
    color: #a0aec0;
}

.upload-zone input[type="file"] {
    display: none;
}

/* ============ FILE PREVIEW ============ */
.file-preview {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    min-height: fit-content;
    overflow: visible;
}

.file-preview h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.preview-item.duplicate {
    border-color: #fed7d7;
    background: #fef5e7;
}

.preview-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-name {
    font-weight: 500;
    color: #2d3748;
}

.preview-size {
    font-size: 0.85rem;
    color: #718096;
}

.preview-status {
    font-size: 1.25rem;
}

.success-icon {
    color: #48bb78;
}

.warning-icon {
    color: #ed8936;
}

/* Upload actions moved to enhanced section below */

/* ============ FILES GRID ============ */
.files-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.no-files-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #718096;
}

.no-files-message i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.no-files-message h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.file-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.file-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-details {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.file-date {
    font-size: 0.8rem;
    color: #a0aec0;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.action-btn {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.download-btn:hover {
    background: #e6fffa;
    border-color: #38b2ac;
}

.view-btn:hover {
    background: #ebf8ff;
    border-color: #4299e1;
}

.delete-btn:hover {
    background: #fed7d7;
    border-color: #e53e3e;
}

/* ============ NOTIFICATIONS ============ */
.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

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

.notification.success {
    border-left-color: #48bb78;
    color: #22543d;
}

.notification.error {
    border-left-color: #e53e3e;
    color: #742a2a;
}

.notification.warning {
    border-left-color: #ed8936;
    color: #7b341e;
}

.notification.info {
    border-left-color: #4299e1;
    color: #2c5282;
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin-left: auto;
    padding: 0.25rem;
    border-radius: 4px;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

/* ============ MODALS ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #edf2f7;
    color: #4a5568;
}

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

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ============ DUPLICATE MODAL STYLES ============ */
.duplicate-list {
    margin: 1rem 0;
}

.duplicate-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fef5e7;
    border-radius: 8px;
    border: 1px solid #fed7d7;
    margin-bottom: 0.75rem;
}

.duplicate-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.duplicate-name {
    font-weight: 500;
    color: #2d3748;
}

.duplicate-details {
    font-size: 0.85rem;
    color: #718096;
}

.warning-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #7b341e;
    background: #fef5e7;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #f6e05e;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.text-warning {
    color: #ed8936;
}

/* ============ PROGRESS MODAL ============ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ============ RESPONSIVE DESIGN ============ */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .files-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .header-left .logo h1 {
        display: none;
    }
    
    .breadcrumb {
        display: none;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .categories-list {
        display: flex;
        overflow-x: auto;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .category-item {
        flex-shrink: 0;
        margin: 0;
        min-width: 120px;
    }
    
    .toolbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .toolbar-right {
        justify-content: center;
    }
    
    .files-grid {
        padding: 1rem;
    }
    
    .files-list {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        margin: 1rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .notification-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }
    
    .notification {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 2rem 1.5rem;
        margin: 0.5rem;
    }
    
    .login-header .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .file-actions {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============ UTILITY CLASSES ============ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ============ SCROLLBAR STYLING ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ============ ENHANCED CATEGORY MANAGEMENT STYLES ============ */

/* Sidebar Actions */
.sidebar-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Enhanced Category Items */
.category-item {
    position: relative;
    user-select: none;
}

.category-item.editing .category-name {
    display: none;
}

.category-item.editing .category-edit-input {
    display: inline-block;
    background: white;
    border: 2px solid #667eea;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: inherit;
    font-weight: 500;
    color: #2d3748;
    min-width: 120px;
}

.category-edit-input {
    display: none;
}

.category-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.category-item.drag-over {
    background: #edf2f7;
    border-left: 3px solid #667eea;
}

/* Upload Steps */
.upload-step {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.upload-step h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.upload-step h3 i {
    color: #667eea;
}

/* Category Selection */
.category-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-dropdown-container {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.category-select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #2d3748;
    transition: all 0.2s ease;
}

.category-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-select option {
    padding: 0.5rem;
}

.category-select option[data-level="1"] {
    padding-left: 1.5rem;
}

.category-select option[data-level="2"] {
    padding-left: 3rem;
}

.category-select option[data-level="3"] {
    padding-left: 4.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.category-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #edf2f7;
    border-radius: 8px;
    color: #4a5568;
    font-weight: 500;
}

.category-path i {
    color: #667eea;
}

.upload-step-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-start;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 160px;
    overflow: hidden;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: #4a5568;
}

.context-menu-item:hover {
    background: #edf2f7;
    color: #2d3748;
}

.context-menu-item[data-action="delete"]:hover {
    background: #fed7d7;
    color: #c53030;
}

.context-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.25rem 0;
}

/* Category Management Modal Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Delete Options */
.delete-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
}

.option-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-group .warning-text {
    font-size: 0.85rem;
    color: #ed8936;
    margin-left: 2.25rem;
    font-style: italic;
}

/* Enhanced File Upload Zone */
.upload-zone h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .category-dropdown-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-step {
        padding: 1rem;
    }
    
    .upload-step h3 {
        font-size: 1.1rem;
    }
    
    .context-menu {
        min-width: 140px;
    }
    
    .sidebar-actions {
        flex-direction: column;
    }
}

/* Animation for category operations */
@keyframes categoryAdded {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-item.newly-added {
    animation: categoryAdded 0.3s ease;
}

/* Loading state for categories */
.category-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.category-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============ ENHANCED FILE ACTIONS ============ */

/* File Actions Enhancement */
.file-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-actions .action-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn {
    background: #48bb78;
    color: white;
}

.download-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.delete-btn {
    background: #f56565;
    color: white;
}

.delete-btn:hover {
    background: #e53e3e;
    transform: translateY(-1px);
}

/* Enhanced File Cards */
.file-item {
    position: relative;
    transition: all 0.2s ease;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* File Info Enhancement */
.file-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.file-name {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-details {
    margin: 0 0 0.25rem 0;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

.file-date {
    margin: 0;
    font-size: 0.8rem;
    color: #a0aec0;
}

/* Enhanced Upload Button in Preview */
.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    position: relative;
    z-index: 10;
}

.upload-actions .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.upload-actions .btn:hover {
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    border: none;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-success:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e2e8f0;
    border: none;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    color: #2d3748;
}

/* Active Category Highlighting */
.category-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.category-item.active .file-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-item.active i {
    color: white;
}

/* Mobile Enhancements for File Actions */
@media (max-width: 768px) {
    .file-actions {
        opacity: 1; /* Always show on mobile */
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .file-actions .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .file-item {
        padding: 1rem;
    }
    
    .file-name {
        font-size: 0.9rem;
    }
    
    .upload-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .upload-actions .btn {
        width: 100%;
        padding: 1rem;
    }
}

/* Success Animation for File Operations */
@keyframes fileSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.file-item.success-animation {
    animation: fileSuccess 0.3s ease;
}

/* ============ UPLOAD BUTTONS VISIBILITY FIX ============ */

/* Ensure upload area has proper height management */
.upload-area {
    max-height: none !important;
    height: auto !important;
}

/* Ensure file preview section is properly contained */
.file-preview {
    position: relative;
    display: block !important;
}

/* Force upload actions to be visible */
.upload-actions {
    position: relative !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    clear: both;
}

/* Ensure content area allows scrolling for upload buttons */
.content-area {
    min-height: 0;
    height: auto;
}

/* Fix for zoom levels */
@media screen and (min-resolution: 96dpi) {
    .upload-actions {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }
    
    .file-preview {
        padding-bottom: 2rem;
    }
}

/* Specific fix for 100% zoom and higher */
@media screen and (min-zoom: 1) {
    .upload-area {
        overflow: visible !important;
        min-height: auto !important;
    }
    
    .upload-actions {
        position: static !important;
        bottom: auto !important;
        margin-top: 2rem !important;
    }
}
