/**
 * PHP File Manager - Styles
 * 
 * Complete styling for the file manager interface including
 * file listings, upload modals, and responsive design.
 */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated background stars */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

@keyframes sparkle {
    from { transform: translateX(0); }
    to { transform: translateX(200px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* Responsive container adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
}

/* File Manager Container */
.file-manager-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

/* Responsive navigation */
@media (max-width: 768px) {
    .nav-bar {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .breadcrumbs {
        margin-bottom: 10px;
        justify-content: center;
    }
    
    .nav-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-bar {
        padding: 8px 10px;
    }
    
    .nav-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-actions .btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
}

.breadcrumb-link {
    color: #667eea;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.breadcrumb-link:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-1px);
}

.breadcrumb-current {
    font-weight: 600;
    color: #1a202c;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.breadcrumb-separator {
    margin: 0 5px;
    color: #6c757d;
}

.nav-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 2px;
}

/* Directory Summary */
.directory-summary {
    display: flex;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.summary-item {
    color: #374151;
    font-weight: 500;
}

/* File Listing */
.file-listing {
    padding: 24px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.empty-directory {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 600px; /* Ensure minimum width for horizontal scroll */
}

.file-table th,
.file-table td {
    padding: 12px;
    text-align: left;
    /* border-bottom: 1px solid #dee2e6; */
    white-space: nowrap;
}

.file-table th,
.file-table tr {
    border-bottom: 1px solid #dee2e6;
}

.file-table th {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

/* Enhanced file name column */
.file-table .file-name {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* File type visual distinctions */
.file-row[data-type="directory"] {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.file-row[data-type="directory"]:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.file-row[data-type="directory"] .file-name {
    font-weight: 500;
}

/* File Selection and Interactive Features */
.file-row.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border-left: 4px solid #667eea;
    backdrop-filter: blur(10px);
}

.file-row:hover {
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-row[data-type="directory"]:hover {
    background-color: #e9ecef;
}

.selection-counter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive file table */
@media (max-width: 768px) {
    .file-listing {
        padding: 15px;
    }
    
    .file-table {
        font-size: 14px;
        min-width: 500px;
    }
    
    .file-table th,
    .file-table td {
        padding: 8px;
    }
    
    .file-table .file-name {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .file-listing {
        padding: 10px;
    }
    
    .file-table {
        font-size: 12px;
        min-width: 400px;
    }
    
    .file-table th,
    .file-table td {
        padding: 6px;
    }
    
    .file-table .file-name {
        max-width: 150px;
    }
}

/* Context Menu */
.context-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 180px;
    padding: 8px 0;
}

.context-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.context-menu-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
}

.context-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
}

.context-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    margin: 6px 0;
}

/* Enhanced File Actions */
.file-actions {
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

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

.file-row.selected .file-actions {
    opacity: 1;
}

/* Button states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-small:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-small:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Refresh button animation */
.btn.refreshing {
    animation: refreshSpin 1s linear infinite;
}

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

/* Action button colors with Galaxy theme */
.rename-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: 1px solid #0891b2;
}

.rename-btn:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 1px solid #dc2626;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

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

.view-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.download-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: 1px solid #7c3aed;
}

.download-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Quick Action Indicators */
.file-row[data-type="directory"] .file-name {
    cursor: pointer;
}

.file-row[data-type="directory"]:hover .file-name {
    color: #007cba;
}

/* Keyboard Shortcut Hints */
.shortcut-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.shortcut-hint.show {
    opacity: 1;
}

/* Enhanced Upload Area */
.upload-drop-zone.dragover {
    border-color: #007cba !important;
    background-color: #e3f2fd !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

.upload-drop-zone {
    transition: all 0.2s ease;
    cursor: pointer;
}

.upload-drop-zone:hover {
    border-color: #007cba;
    background-color: #f8f9fa;
}

/* Upload Progress Enhancements */
.upload-progress {
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #0056b3);
    border-radius: 12px;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 124, 186, 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.3) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* Upload info styling */
.upload-info {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.upload-info p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #1565c0;
}

.upload-info ul {
    margin: 0;
    padding-left: 20px;
}

.upload-info li {
    margin-bottom: 5px;
    color: #1976d2;
    font-size: 14px;
}

/* Enhanced Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 16px;
    color: white;
    z-index: 10000;
    max-width: 400px;
    word-wrap: break-word;
    white-space: pre-line;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-left: 4px solid #047857;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-left: 4px solid #b91c1c;
}

.notification.info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-left: 4px solid #0e7490;
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1f2937;
    border-left: 4px solid #b45309;
}

.notification:hover {
    transform: translateX(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Loading Indicator Enhancements */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.loading-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(102, 126, 234, 0.2);
    border-top: 6px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: #374151;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.025em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.help-content {
    max-height: 400px;
    overflow-y: auto;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.shortcut-item kbd {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    color: #495057;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shortcut-item span {
    color: #6c757d;
    font-size: 14px;
}

.file-name {
    display: flex;
    align-items: center;
}

.file-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.file-row:hover .file-icon {
    transform: scale(1.1);
}

/* Enhanced File Icons with better visual distinctions */
.icon-folder { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffc107"><path d="M10 4H4c-1.11 0-2 .89-2 2v12c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2h-8l-2-2z"/></svg>'); 
}

.icon-file { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236c757d"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

.icon-image { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2328a745"><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"/></svg>'); 
}

.icon-document { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23dc3545"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

.icon-archive { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23fd7e14"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

.icon-code { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236f42c1"><path d="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z"/></svg>'); 
}

.icon-video { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e91e63"><path d="M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z"/></svg>'); 
}

.icon-audio { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239c27b0"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"/></svg>'); 
}

.icon-pdf { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f44336"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

.icon-text { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23607d8b"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

.icon-word { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232b579a"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

.icon-excel { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23217346"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

.icon-powerpoint { 
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23d24726"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>'); 
}

/* File type badges */
.file-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.file-type-badge.image { background-color: #e8f5e8; color: #2e7d32; }
.file-type-badge.document { background-color: #ffebee; color: #c62828; }
.file-type-badge.archive { background-color: #fff3e0; color: #ef6c00; }
.file-type-badge.code { background-color: #f3e5f5; color: #7b1fa2; }
.file-type-badge.video { background-color: #fce4ec; color: #ad1457; }
.file-type-badge.audio { background-color: #f3e5f5; color: #7b1fa2; }
.file-type-badge.pdf { background-color: #ffebee; color: #d32f2f; }
.file-type-badge.text { background-color: #eceff1; color: #455a64; }
.file-type-badge.word { background-color: #e3f2fd; color: #1565c0; }
.file-type-badge.excel { background-color: #e8f5e8; color: #2e7d32; }
.file-type-badge.powerpoint { background-color: #ffebee; color: #c62828; }

.directory-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.directory-link:hover {
    text-decoration: underline;
}

.file-actions {
    white-space: nowrap;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    margin: 5% auto;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px 24px 0 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.modal-header h3 {
    margin: 0;
    color: #1a202c;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: #374151;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
}

/* Upload Area */
.upload-area {
    margin-bottom: 24px;
}

.upload-drop-zone {
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    backdrop-filter: blur(10px);
}

.upload-drop-zone:hover,
.upload-drop-zone.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.upload-drop-zone input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-options {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.upload-options label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.upload-options label:hover {
    color: #007cba;
}

.upload-options label:last-child {
    margin-bottom: 0;
}

.upload-options input[type="checkbox"] {
    margin-right: 8px;
}

.upload-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.upload-info ul {
    margin: 10px 0 0 20px;
}

/* Progress Bar */
.upload-progress {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-weight: 500;
    color: #495057;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    letter-spacing: 0.025em;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    backdrop-filter: blur(10px);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

input[type="text"]:invalid,
input[type="password"]:invalid,
input[type="email"]:invalid {
    border-color: #dc3545;
}

input[type="text"]:invalid:focus,
input[type="password"]:invalid:focus,
input[type="email"]:invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Enhanced checkbox and radio styles */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: #007cba;
}

/* Error and Success Messages */
.error {
    color: #dc3545;
    background-color: #f8d7da;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success {
    color: #155724;
    background-color: #d4edda;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.warning {
    color: #856404;
    background-color: #fff3cd;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #ffeaa7;
}

/* Main Navigation */
.main-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #667eea;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.brand-icon {
    font-size: 28px;
    margin-right: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text {
    display: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-items {
    display: flex;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #64748b;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    transform: translateY(-1px);
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-icon {
    font-size: 16px;
    margin-right: 6px;
}

.nav-text {
    display: none;
}

/* User Menu */
.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    font-size: 14px;
}

.user-name {
    font-weight: 600;
    color: #495057;
}

.user-role {
    font-size: 12px;
    color: #6c757d;
    text-transform: capitalize;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
    backdrop-filter: blur(10px);
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    font-size: 18px;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.user-menu-toggle:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
}

.dropdown-user-info strong {
    display: block;
    color: #495057;
    font-size: 14px;
}

.dropdown-user-info small {
    color: #6c757d;
    font-size: 12px;
    text-transform: capitalize;
}

.dropdown-divider {
    height: 1px;
    background-color: #f1f3f4;
    margin: 0;
}

.dropdown-items {
    padding: 10px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    font-size: 13px;
    color: #6c757d;
}

.item-icon {
    margin-right: 8px;
    font-size: 14px;
}

.dropdown-actions {
    padding: 10px 0;
}

.dropdown-action {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #495057;
    transition: background-color 0.2s;
    font-size: 14px;
}

.dropdown-action:hover {
    background-color: #f8f9fa;
}

.logout-action {
    color: #dc3545;
}

.logout-action:hover {
    background-color: #f8d7da;
}

.action-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 3px;
}

.hamburger {
    width: 20px;
    height: 2px;
    background-color: #495057;
    transition: all 0.3s;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.mobile-nav-overlay.show .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.mobile-brand {
    font-weight: 600;
    color: #007cba;
    font-size: 18px;
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-items {
    flex: 1;
    padding: 20px 0;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #495057;
    transition: background-color 0.2s;
}

.mobile-nav-item:hover {
    background-color: #f8f9fa;
}

.mobile-nav-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
}

.mobile-user-info {
    margin-bottom: 15px;
}

.mobile-user-info strong {
    display: block;
    color: #495057;
    font-size: 14px;
}

.mobile-user-info small {
    color: #6c757d;
    font-size: 12px;
    text-transform: capitalize;
}

.mobile-logout-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.mobile-logout-btn:hover {
    background-color: #c82333;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 24px;
    position: relative;
    z-index: 2;
}

.main-content.authenticated {
    padding-top: 0;
}

.main-content.guest {
    padding-top: 40px;
}

/* Footer */
.main-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 24px 0;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-text {
    color: #374151;
    font-weight: 600;
    font-size: 16px;
}

.footer-version {
    color: #64748b;
    font-size: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.footer-links {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    z-index: 10000;
    max-width: 400px;
    word-wrap: break-word;
    white-space: pre-line;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.info {
    background-color: #17a2b8;
}

.notification.warning {
    background-color: #ffc107;
    color: #212529;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-text {
    color: #495057;
    font-weight: 500;
}

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

/* Login Form */
.form-container {
    max-width: 440px;
    margin: 50px auto;
    padding: 48px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

/* Responsive Design */
@media (min-width: 768px) {
    .brand-text,
    .nav-text {
        display: inline;
    }
    
    .user-info {
        display: flex;
    }
}

@media (max-width: 768px) {
    body::before {
        opacity: 0.2;
    }
    
    .container {
        padding: 15px;
    }
    
    .nav-content {
        padding: 0 20px;
        height: 60px;
    }
    
    .brand-link {
        font-size: 18px;
    }
    
    .brand-icon {
        font-size: 24px;
        margin-right: 10px;
    }
    
    .nav-items {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 16px 20px;
    }
    
    .nav-actions {
        justify-content: center;
    }
    
    .directory-summary {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
    }
    
    .file-manager-container {
        border-radius: 20px;
    }
    
    .file-table {
        font-size: 14px;
    }
    
    .file-table th,
    .file-table td {
        padding: 10px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        border-radius: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 20px;
    }
    
    .form-container {
        margin: 30px auto;
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body::before {
        opacity: 0.15;
    }
    
    .nav-content {
        height: 50px;
        padding: 0 16px;
    }
    
    .brand-link {
        font-size: 16px;
    }
    
    .brand-icon {
        font-size: 20px;
        margin-right: 8px;
    }
    
    .file-manager-container {
        border-radius: 16px;
    }
    
    .nav-bar {
        padding: 12px 16px;
    }
    
    .file-listing {
        padding: 16px;
    }
    
    .file-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .breadcrumbs {
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 98%;
        border-radius: 16px;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 16px;
    }
    
    .form-container {
        margin: 20px auto;
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        border-radius: 12px;
    }
}

/* File Type Specific Styling */
.file-row[data-extension="pdf"] .file-name {
    color: #dc3545;
}

.file-row[data-extension="jpg"] .file-name,
.file-row[data-extension="jpeg"] .file-name,
.file-row[data-extension="png"] .file-name,
.file-row[data-extension="gif"] .file-name {
    color: #28a745;
}

.file-row[data-extension="zip"] .file-name,
.file-row[data-extension="rar"] .file-name,
.file-row[data-extension="7z"] .file-name {
    color: #fd7e14;
}

.file-row[data-extension="js"] .file-name,
.file-row[data-extension="php"] .file-name,
.file-row[data-extension="html"] .file-name,
.file-row[data-extension="css"] .file-name {
    color: #6f42c1;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet styles */
@media (max-width: 768px) {
    /* Modal responsive styles */
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-width: none;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 15px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Upload area adjustments */
    .upload-drop-zone {
        padding: 30px 15px;
    }
    
    /* Directory summary responsive */
    .directory-summary {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Button adjustments */
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    /* Context menu adjustments */
    .context-menu {
        min-width: 120px;
    }
    
    .context-menu-item {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    /* Modal mobile styles */
    .modal-content {
        margin: 5% auto;
        width: 98%;
        border-radius: 8px;
    }
    
    .modal-header {
        border-radius: 8px 8px 0 0;
    }
    
    .modal-actions {
        border-radius: 0 0 8px 8px;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 12px;
    }
    
    /* Upload area mobile */
    .upload-drop-zone {
        padding: 20px 10px;
        font-size: 14px;
    }
    
    /* File actions mobile */
    .file-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .btn-small {
        padding: 3px 6px;
        font-size: 11px;
        margin: 0;
    }
    
    /* Breadcrumbs mobile */
    .breadcrumbs {
        font-size: 14px;
    }
    
    .breadcrumb-link,
    .breadcrumb-current {
        padding: 3px 6px;
    }
    
    /* Selection counter mobile */
    .selection-counter {
        font-size: 12px;
        padding: 4px 8px;
        margin-left: 8px;
    }
    
    /* Help modal mobile adjustments */
    .help-content {
        max-height: 300px;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .shortcut-item kbd {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* Large screen enhancements */
@media (min-width: 1200px) {
    .file-manager-container {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .file-table th,
    .file-table td {
        padding: 15px;
    }
    
    .file-icon {
        width: 28px;
        height: 28px;
    }
    
    .modal-content {
        max-width: 700px;
    }
}

/* Print styles */
@media print {
    .nav-actions,
    .file-actions,
    .modal,
    .context-menu,
    .selection-counter {
        display: none !important;
    }
    
    .file-manager-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .file-table {
        font-size: 12px;
    }
    
    .file-table th,
    .file-table td {
        padding: 6px;
        border: 1px solid #000;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .file-row:hover {
        background-color: #000;
        color: #fff;
    }
    
    .file-row.selected {
        background-color: #000 !important;
        color: #fff;
        border-left-color: #fff;
    }
    
    .btn-primary {
        background-color: #000;
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .modal-content {
        animation: none;
    }
    
    .file-icon {
        transition: none;
    }
    
    .upload-drop-zone {
        transition: none;
    }
}
/* ===== ENHANCED ERROR HANDLING STYLES ===== */

/* Error message container */
.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
    animation: errorSlideIn 0.3s ease-out;
}

.error-title {
    font-weight: 600;
    font-size: 16px;
    color: #721c24;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.error-title::before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 18px;
}

.error-text {
    color: #721c24;
    line-height: 1.5;
    margin-bottom: 8px;
}

.error-code {
    font-size: 12px;
    color: #856404;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

/* Success message styles */
.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
    color: #155724;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
    animation: successSlideIn 0.3s ease-out;
}

.success-message::before {
    content: "✅";
    margin-right: 8px;
    font-size: 16px;
}

/* Warning message styles */
.warning-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
    color: #856404;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.1);
}

.warning-message::before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 16px;
}

/* Info message styles */
.info-message {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
    color: #0c5460;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.1);
}

.info-message::before {
    content: "ℹ️";
    margin-right: 8px;
    font-size: 16px;
}

/* Error type specific styles */
.error-message[data-error-type="authentication"] {
    border-left-color: #dc3545;
}

.error-message[data-error-type="authorization"] {
    border-left-color: #fd7e14;
}

.error-message[data-error-type="validation"] {
    border-left-color: #ffc107;
}

.error-message[data-error-type="file_operation"] {
    border-left-color: #6f42c1;
}

.error-message[data-error-type="upload"] {
    border-left-color: #e83e8c;
}

.error-message[data-error-type="system"] {
    border-left-color: #6c757d;
}

.error-message[data-error-type="security"] {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
}

/* Animations */
@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Error message responsive styles */
@media (max-width: 768px) {
    .error-message,
    .success-message,
    .warning-message,
    .info-message {
        padding: 12px 15px;
        margin: 10px 0;
    }
    
    .error-title {
        font-size: 14px;
    }
    
    .error-text {
        font-size: 14px;
    }
    
    .error-code {
        font-size: 11px;
    }
}

/* Legacy error styles for backward compatibility */
.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
    color: #721c24;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
}

.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px 0;
    color: #155724;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}
/* ===== FORM FIELD ERROR STYLES ===== */

/* Input field error state */
input.error,
textarea.error,
select.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
    background-color: #fff5f5;
}

/* Field error message */
.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    animation: fieldErrorSlideIn 0.3s ease-out;
}

.field-error::before {
    content: "⚠️";
    margin-right: 5px;
    font-size: 14px;
}

/* Field success state */
input.success,
textarea.success,
select.success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.field-success {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.field-success::before {
    content: "✅";
    margin-right: 5px;
}

/* Form validation animations */
@keyframes fieldErrorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form group with error */
.form-group.has-error label {
    color: #dc3545;
}

.form-group.has-success label {
    color: #28a745;
}

/* Validation summary */
.validation-summary {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    color: #721c24;
}

.validation-summary h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

.validation-summary li {
    margin-bottom: 5px;
}

/* Real-time validation indicators */
.validation-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}

.validation-indicator.valid {
    color: #28a745;
}

.validation-indicator.invalid {
    color: #dc3545;
}

/* Form field containers with validation */
.form-field-container {
    position: relative;
}

.form-field-container input,
.form-field-container textarea,
.form-field-container select {
    padding-right: 40px;
}

/* Dark mode support for Galaxy theme */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    }
    
    body::before {
        opacity: 0.4;
    }
    
    .file-manager-container,
    .modal-content,
    .form-container {
        background: rgba(17, 24, 39, 0.95);
        border: 1px solid rgba(75, 85, 99, 0.3);
    }
    
    .nav-bar,
    .directory-summary,
    .modal-header {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    }
    
    .file-listing,
    .file-content,
    .modal-body {
        background: rgba(31, 41, 55, 0.5);
    }
    
    .file-table th {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
        color: #d1d5db;
    }
    
    .file-table td {
        color: #e5e7eb;
        border-bottom-color: rgba(75, 85, 99, 0.3);
    }
    
    .breadcrumb-current {
        color: #f9fafb;
        background: rgba(55, 65, 81, 0.8);
    }
    
    .breadcrumb-link {
        color: #a78bfa;
    }
    
    .summary-item {
        color: #d1d5db;
    }
    
    .modal-header h3 {
        color: #f9fafb;
    }
    
    .form-group label {
        color: #d1d5db;
    }
    
    .form-group input {
        background: rgba(31, 41, 55, 0.8);
        border-color: #374151;
        color: #f9fafb;
    }
    
    .form-group input:focus {
        border-color: #667eea;
        background: rgba(31, 41, 55, 0.9);
    }
    
    .btn-secondary {
        background: rgba(55, 65, 81, 0.9);
        color: #a78bfa;
        border-color: rgba(102, 126, 234, 0.3);
    }
    
    .btn-secondary:hover {
        background: rgba(55, 65, 81, 1);
    }
    
    .upload-drop-zone {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
        border-color: rgba(102, 126, 234, 0.4);
    }
    
    .main-nav {
        background: rgba(17, 24, 39, 0.95);
    }
    
    .user-dropdown {
        background: rgba(17, 24, 39, 0.95);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .nav-item {
        color: #9ca3af;
    }
    
    .nav-item:hover {
        color: #a78bfa;
    }
    
    .user-menu-toggle {
        background: rgba(55, 65, 81, 0.9);
        border-color: rgba(102, 126, 234, 0.3);
        color: #d1d5db;
    }
    
    .file-row:hover {
        background: rgba(55, 65, 81, 0.7);
    }
    
    .file-row[data-type="directory"] {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    }
    
    .file-row[data-type="directory"]:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    }
}