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

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

body {
    background-color: #f5f7fa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1a1f36;
    margin: 0;
    padding: 0;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 450px;
    border: 1px solid #e2e8f0;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #1a1f36;
    margin-bottom: 8px;
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-header h2 i {
    color: #667eea;
    font-size: 1.3em;
}

.login-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background: #f8fafc;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    background: #ffffff;
}

.btn {
    padding: 0.875rem 1.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: #ebf8ff;
    color: #2b6cb0;
    border-color: #90cdf4;
}

.btn-primary:hover {
    background: #bee3f8;
    color: #2c5282;
    border-color: #63b3ed;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
    transform: translateY(-1px);
}

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

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #feb2b2;
}

.success-message {
    background: #c6f6d5;
    color: #2f855a;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #9ae6b4;
}

.login-info {
    margin-top: 20px;
    text-align: center;
    color: #999;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-info i {
    color: #667eea;
}

/* Enhanced login form styling */
.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

.form-group label i {
    color: #667eea;
    width: 16px;
    text-align: center;
}

/* Login button enhancements */
.login-box .btn-primary {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    transition: all 0.2s;
    width: 100%;
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
}

.login-box .btn-primary:hover {
    background: #bee3f8;
    color: #2c5282;
    border-color: #63b3ed;
    transform: translateY(-1px);
}

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

/* Error message enhancements */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #feb2b2;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.error-message i {
    color: #e53e3e;
    font-size: 1.1em;
}

/* Success message styling */
.success-message {
    background: #c6f6d5;
    color: #2f855a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #9ae6b4;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.success-message i {
    color: #38a169;
    font-size: 1.1em;
}

/* Password Change Page */
.password-change-container {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    min-height: calc(100vh - 100px);
}

.password-change-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 500px;
}

.password-change-box h2 {
    margin-bottom: 30px;
    color: #1a1f36;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.password-change-box label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.875rem;
}

.password-change-box small {
    color: #999;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.password-change-box .btn {
    width: 100%;
    margin-top: 10px;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    background: #f5f7fa;
}

.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #1a1f36;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 i {
    color: #667eea;
    font-size: 1.3em;
}

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

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4a5568;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.mobile-menu-toggle:hover {
    background: #f7fafc;
    color: #2d3748;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.user-info span {
    color: #4a5568;
    font-size: 0.95rem;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.toolbar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.breadcrumb-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
    transform: translateY(-1px);
}

.breadcrumb-item i {
    font-size: 0.875rem;
    color: #667eea;
}

.breadcrumb-item.drag-over {
    background: #ebf8ff !important;
    border-color: #3182ce !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.2);
}

.breadcrumb-separator {
    color: #cbd5e0;
    font-size: 0.75rem;
}

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

/* Bulk Actions */
.bulk-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bulk-actions .btn {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.normal-actions .btn {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bulk-selected-count {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* File Checkboxes */
.file-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.mobile-checkbox {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.file-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8fafc;
}

th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

th:last-child {
    text-align: right;
}

th.checkbox-column {
    width: 50px;
    padding: 1rem calc(0.75rem + 3px);
}

td.checkbox-column {
    width: 50px;
    padding: 1rem 0.75rem;
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

tr:hover {
    background: #f8fafc;
}

tr:last-child td {
    border-bottom: none;
}

.folder-link {
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.folder-link:hover {
    color: #2c5282;
}

.folder-link i {
    color: #ffa726;
    font-size: 1.1em;
}

.file-name {
    color: #1a1f36;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-name i {
    font-size: 1.1em;
}


.file-row[draggable="true"] {
    cursor: move;
}

.file-row.dragging {
    opacity: 0.5;
}

.file-row.drop-zone {
    transition: all 0.2s;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.file-row.drop-zone:hover {
    background: #f8fafc;
}

.file-row.drop-zone.drag-over {
    background: #ebf8ff !important;
    border-left: 4px solid #3182ce !important;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 3rem !important;
    font-size: 0.95rem;
}

.actions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.btn-action {
    padding: 0.5rem 0.875rem;
    background: #ebf8ff;
    color: #2b6cb0;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #90cdf4;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action:hover {
    background: #bee3f8;
    color: #2c5282;
    border-color: #63b3ed;
    transform: translateY(-1px);
}

.btn-danger {
    background: #fff5f5;
    border-color: #feb2b2;
    color: #c53030;
}

.btn-danger:hover {
    background: #fed7d7;
    border-color: #fc8181;
    color: #c53030;
}

.btn-danger:active {
    background: #fecaca;
}

/* Drag and Drop File Upload */
body.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    transition: background-color 0.2s ease;
}

body.drag-over::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    border: 3px dashed #3b82f6;
    pointer-events: none;
    z-index: 1000;
}

.upload-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.upload-progress-modal {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.upload-progress-modal h3 {
    margin-bottom: 1rem;
    color: #1a1f36;
    font-size: 1.25rem;
    font-weight: 600;
}

.upload-files-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

.upload-file-item {
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568;
}

/* Upload Success Message */
.upload-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.upload-success-modal {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
}

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

.upload-success-icon {
    margin-bottom: 1rem;
}

.upload-success-icon i {
    font-size: 3rem;
    color: #10b981;
}

.upload-success-modal h3 {
    margin-bottom: 0.5rem;
    color: #1a1f36;
    font-size: 1.5rem;
    font-weight: 600;
}

.upload-success-message {
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-size: 1.1rem;
}

.upload-success-location {
    margin-bottom: 1.5rem;
    color: #667eea;
    font-size: 1rem;
}

.upload-success-files {
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

.upload-success-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-success-file:last-child {
    margin-bottom: 0;
}

.upload-success-file i {
    color: #667eea;
}

/* Confirmation Modal */
.confirm-modal-content {
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.confirm-header {
    margin-bottom: 1.5rem;
}

.confirm-icon {
    margin-bottom: 1rem;
}

.confirm-icon i {
    font-size: 3rem;
    color: #f59e0b;
}

.confirm-header h2 {
    color: #1a1f36;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.confirm-body {
    margin-bottom: 2rem;
}

.confirm-body p {
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.confirm-actions .btn {
    min-width: 120px;
    padding: 0.875rem 1.5rem;
    font-weight: 500;
}

.confirm-actions .btn-secondary {
    background: #f8fafc;
    color: #4a5568;
    border-color: #e2e8f0;
}

.confirm-actions .btn-secondary:hover {
    background: #f1f5f9;
    color: #2d3748;
    border-color: #cbd5e0;
}

.confirm-actions .btn-danger {
    background: #fed7d7;
    color: #c53030;
    border-color: #feb2b2;
}

.confirm-actions .btn-danger:hover {
    background: #feb2b2;
    color: #9c2626;
    border-color: #fc8181;
}

/* Drag and Drop File Items */
.file-item {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: #f8fafc;
}

.file-item.dragging {
    opacity: 1;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.file-item-handle {
    cursor: move;
    padding: 0.5rem;
    margin: -0.5rem 0.5rem -0.5rem -0.5rem;
    color: #a0aec08f;
    transition: all 0.2s;
}

.file-item-handle:hover {
    color: #747d8a8f;
}

.file-placeholder {
    border: 2px dashed #93c5fd;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 0.75rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.show, .modal.animating-in, .modal.animating-out {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: translateY(-30px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-height: 85vh;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal.animating-in {
    opacity: 0;
    animation: modalFadeIn 0.3s ease-out forwards;
}

.modal.animating-out {
    opacity: 1;
    animation: modalFadeOut 0.2s ease-in forwards;
}

.modal.animating-in .modal-content {
    transform: translateY(-30px) scale(0.95);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal.animating-out .modal-content {
    transform: translateY(0) scale(1);
    animation: modalSlideOut 0.2s ease-in forwards;
}

@keyframes modalFadeIn {
    to { opacity: 1; }
}

@keyframes modalFadeOut {
    to { opacity: 0; }
}

@keyframes modalSlideIn {
    to { transform: translateY(0) scale(1); }
}

@keyframes modalSlideOut {
    to { transform: translateY(-20px) scale(0.95); }
}

.close {
    position: absolute;
    right: 20px;
    top: 28px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #1a1f36;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

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

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

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

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

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

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

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

/* Scrollbar Styling */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

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

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile-First Responsive Design */

/* Small mobile devices (320px and up) */
@media (max-width: 480px) {
    /* Login page mobile styles */
    .login-container {
        min-height: calc(100vh - 120px);
        padding: 1rem;
    }
    
    .login-box {
        padding: 1.5rem;
        max-width: 100%;
        border-radius: 12px;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.875rem;
    }
    
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .login-box .btn-primary {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
    /* Bulk Actions Mobile */
    .bulk-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }
    
    .bulk-selected-count {
        width: 100%;
        text-align: center;
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    .bulk-actions .btn {
        flex: 1;
        min-width: 0;
    }
    
    .normal-actions {
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
    }
    
    .normal-actions .btn {
        flex: 1;
        min-width: 0;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 0.75rem;
        position: relative;
    }
    
    .header h1 {
        font-size: 1.25rem;
        margin: 0;
        flex: 1;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 3;
    }
    
    .user-info {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #e2e8f0;
        border-top: none;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 10px;
        padding: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .user-info.mobile-menu-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .welcome-text {
        font-size: 0.875rem;
        text-align: center;
        color: #4a5568;
    }
    
    .btn-secondary {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        justify-content: center;
    }
    
    .btn-danger {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        justify-content: center;
    }
    
    .btn-text {
        display: inline;
    }
    
    .main-content {
        padding: 0.75rem;
        overflow: visible;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 1rem;
        min-width: 0;
        overflow: hidden;
    }
    
    .toolbar .actions {
        width: 100%;
    }
    
    .breadcrumb {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
        scroll-behavior: smooth;
        position: relative;
        width: 100%;
        min-width: 0;
    }
    
    /* Add a subtle gradient fade on the right to indicate scrollable content */
    .breadcrumb::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 20px;
        height: 100%;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.8), transparent);
        pointer-events: none;
        z-index: 1;
        opacity: var(--show-gradient, 1);
        transition: opacity 0.2s ease;
    }
    
    .breadcrumb::-webkit-scrollbar {
        display: none;
    }
    
    .breadcrumb-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .breadcrumb-separator {
        flex-shrink: 0;
        margin: 0 0.25rem;
    }
    
    .actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .btn-primary {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        min-height: 48px; /* Better touch target */
    }
    
    /* Mobile-optimized file list - Card-based approach */
    .file-list {
        border-radius: 12px;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        border: 1px solid #e2e8f0;
        overflow: visible;
        position: relative;
    }
    
    /* Hide table on small mobile, show card view */
    .file-list table {
        display: none;
    }
    
    .mobile-card-view {
        display: block;
    }
    
    .mobile-card {
        background: white;
        border-bottom: 1px solid #e5e7eb;
        transition: all 0.2s ease;
        position: relative;
        min-height: 48px;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }
    
    .mobile-card:last-child {
        border-bottom: none;
    }
    
    .mobile-card:hover {
        background: #f8fafc;
    }
    
    .mobile-card-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex: 1;
        cursor: pointer;
        min-height: 48px;
        padding: 0.6rem 1rem;
    }
    
    .mobile-card-icon {
        font-size: 1.25rem;
        flex-shrink: 0;
        width: 20px;
        text-align: center;
    }
    
    .mobile-card-name {
        font-weight: 500;
        color: #1a1f36;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.9rem;
    }
    
    .mobile-card-expand {
        color: #6b7280;
        font-size: 0.75rem;
        transition: transform 0.2s ease;
        flex-shrink: 0;
    }
    
    .mobile-card.expanded .mobile-card-expand {
        transform: rotate(180deg);
    }
    
    .mobile-card-details {
        display: none;
        background: #f8fafc;
        border-top: 1px solid #e5e7eb;
        padding: 0.75rem 1rem;
        margin: 0;
    }
    
    .mobile-card.expanded .mobile-card-details {
        display: block;
    }
    
    .mobile-card.expanded {
        background: #f8fafc;
        border-left: none !important;
        z-index: 5;
    }
    
    
    .mobile-card-info {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.75rem;
        font-size: 0.8rem;
    }
    
    .mobile-card-info-item {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
        flex: 1;
    }
    
    .mobile-card-info-label {
        font-weight: 500;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }
    
    .mobile-card-info-value {
        color: #374151;
        font-size: 0.8rem;
    }
    
    .mobile-card-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    .btn-action {
        flex: 1;
        min-width: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        text-align: center;
        min-height: 36px;
        justify-content: center;
        border-radius: 6px;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .btn-action:active {
        opacity: 0.8;
    }
    
    .btn-action i {
        margin-right: 0.5rem;
    }
    
    /* Mobile card interactions */
    .mobile-card-header:active {
        background: #f0f0f0;
        border-radius: 6px;
    }
    
    /* Better visual hierarchy for list view */
    .mobile-card-name {
        font-weight: 500;
    }
    
    .mobile-card-info-label {
        font-weight: 500;
    }
    
    /* List-like appearance - no left borders for mobile */
    .mobile-card {
        border-left: none !important;
        transition: all 0.2s ease;
    }
    
    .mobile-card:hover {
        background: #f8fafc;
    }
    
    .mobile-card.expanded {
        background: #f8fafc;
        border-left: none !important;
        z-index: 5;
    }
    
    /* Override desktop drag-and-drop styles for mobile cards */
    .mobile-card.drop-zone {
        border-left: none !important;
    }
    
    .mobile-card.drop-zone:hover {
        background: #f8fafc;
    }
    
    .mobile-card.drop-zone.drag-over {
        background: #ebf8ff;
        border-left: none !important;
    }
    
    .mobile-card.expanded .mobile-card-header {
        margin-bottom: 0;
    }
    
    /* Improved button styling */
    .btn-action.btn-danger {
        background: #fef2f2;
        color: #dc2626;
        border: 1px solid #fecaca;
    }
    
    .btn-action.btn-danger:hover {
        background: #fee2e2;
        border-color: #fca5a5;
    }
    
    .btn-action:not(.btn-danger) {
        background: #f0f9ff;
        color: #0369a1;
        border: 1px solid #bae6fd;
    }
    
    .btn-action:not(.btn-danger):hover {
        background: #e0f2fe;
        border-color: #7dd3fc;
    }
    
    
    .modal-content {
        width: 95%;
        padding: 1rem;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-content h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .close {
        right: 15px;
        top: 15px;
        font-size: 24px;
    }
}

/* Medium mobile devices (481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {

    .bulk-actions {
        flex-wrap: nowrap;
        gap: 0.75rem;
    }
    
    .bulk-selected-count {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .user-info {
        flex-direction: row;
        gap: 12px;
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .btn-text {
        display: inline;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }
    
    .breadcrumb {
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        flex-wrap: nowrap;
        scroll-behavior: smooth;
    }
    
    .breadcrumb::-webkit-scrollbar {
        display: none;
    }
    
    /* Hide mobile card view, show table view */
    .file-list table {
        display: table;
    }
    
    .mobile-card-view {
        display: none;
    }
    
    .actions {
        flex-direction: row;
        gap: 10px;
        flex-shrink: 0;
    }
    
    .btn-primary {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    
    /* Medium mobile - hybrid approach */
    .file-list {
        background: white;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        border: 1px solid #e2e8f0;
    }
    
    .file-list table {
        display: table;
        font-size: 0.875rem;
        width: 100%;
    }
    
    .mobile-card-view {
        display: none;
    }
    
    th, td {
        padding: 0.75rem 0.6rem;
        vertical-align: middle;
    }
    
    .file-name, .folder-link {
        font-size: 0.875rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .actions-cell {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .btn-action {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 40px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .modal-content {
        width: 90%;
        padding: 1.5rem;
    }
}

/* Tablet and small desktop (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-content {
        padding: 1.25rem 1.5rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .toolbar {
        padding: 1.25rem;
    }
    
    .actions {
        gap: 12px;
    }
    
    .btn-primary {
        padding: 0.875rem 1.5rem;
    }
    
    /* Hide mobile card view, show table view */
    .file-list table {
        display: table;
    }
    
    .mobile-card-view {
        display: none;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 1rem 1rem;
    }
}

/* Large screens (1025px and up) */
@media (min-width: 1025px) {
    .header-content {
        padding: 1.25rem 2rem;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    .toolbar {
        padding: 1.5rem;
    }
    
    .actions {
        gap: 15px;
    }
    
    /* Hide mobile card view, show table view */
    .file-list table {
        display: table;
    }
    
    .mobile-card-view {
        display: none;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, .btn-action, .breadcrumb-item {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .file-row {
        min-height: 60px;
        padding: 0.75rem 0;
    }
    
    
    .folder-link, .file-name {
        padding: 0.75rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .actions-cell {
        min-height: 60px;
        padding: 0.5rem 0;
    }
    
    .btn-action {
        min-height: 44px;
        min-width: 80px;
        justify-content: center;
    }
    
    /* Mobile card touch optimizations */
    .mobile-card-header {
        min-height: 48px;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .mobile-card {
        margin-bottom: 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .mobile-card:last-child {
        border-bottom: none;
    }
    
    .mobile-card:first-child {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }
    
    .mobile-card:last-child {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    
    /* Improve touch feedback */
    .btn:active, .breadcrumb-item:active {
        opacity: 0.8;
        transition: opacity 0.1s ease;
    }
    
    .file-row:active {
        background: #e2e8f0;
        transition: background 0.1s ease;
    }
    
    .mobile-card:active {
        opacity: 0.95;
        transition: opacity 0.1s ease;
    }
    
    /* Better spacing for touch */
    .toolbar {
        padding: 1rem;
        gap: 1rem;
    }
    
    .actions {
        gap: 0.75rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .header-content {
        flex-direction: row;
        padding: 0.75rem;
    }
    
    .user-info {
        flex-direction: row;
        gap: 10px;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .toolbar {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .breadcrumb {
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        flex-wrap: nowrap;
        scroll-behavior: smooth;
    }
    
    .breadcrumb::-webkit-scrollbar {
        display: none;
    }
    
    .actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .btn-primary {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* Very small mobile devices - compact list view */
@media (max-width: 360px) {
    .mobile-card {
        padding: 0.5rem 0.75rem;
        min-height: 40px;
    }
    
    .mobile-card-header {
        min-height: 28px;
        gap: 0.5rem;
    }
    
    .mobile-card-icon {
        font-size: 1.1rem;
        width: 18px;
    }
    
    .mobile-card-name {
        font-size: 0.85rem;
    }
    
    .mobile-card-expand {
        font-size: 0.7rem;
    }
    
    
    .mobile-card-info {
        gap: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .mobile-card-actions {
        gap: 0.375rem;
    }
    
    .btn-action {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
    
    .mobile-card-info-item {
        gap: 0.125rem;
    }
    
    .mobile-card-info-label {
        font-size: 0.7rem;
    }
    
    .mobile-card-info-value {
        font-size: 0.75rem;
    }
}

/* Mobile loading states */
.mobile-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
}

.mobile-loading i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}


/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header h1 i {
        font-size: 1.4em;
    }
    
    .folder-link i, .file-name i {
        font-size: 1.2em;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Preview Modal Styles */
.preview-modal {
    backdrop-filter: blur(4px);
    background-color: rgb(245, 247, 250)
}

.preview-modal .modal-content {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
}

.preview-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.preview-header h2 {
    margin: 0;
    font-size: 1rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 1rem;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.preview-close-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.preview-close-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.preview-close-btn:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

.preview-content {
    flex: 1;
    overflow: auto;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    position: relative;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    color: #667eea;
    font-size: 1.1rem;
    padding: 3rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    min-width: 200px;
    z-index: 10;
}

.preview-loading i {
    font-size: 2.5rem;
}

.preview-loading .loading-text {
    font-size: 1rem;
    font-weight: 500;
}

.preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #dc2626;
    padding: 2rem;
}

.preview-error i {
    font-size: 3rem;
    opacity: 0.5;
}

.preview-error p {
    font-size: 1rem;
    margin: 0;
}

/* Image Preview */
.preview-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
    background: #f8fafc;
}

.preview-image {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Video Preview */
.preview-video-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
    background: #000000;
}

.preview-video {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    border-radius: 8px;
}

/* Audio Preview */
.preview-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 3rem;
    gap: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-audio-icon {
    font-size: 5rem;
    color: #ffffff;
    opacity: 0.9;
}

.preview-audio {
    width: 100%;
    max-width: 500px;
}

/* PDF Preview */
.preview-pdf-container {
    width: 100%;
    height: 100%;
    display: flex;
}

.preview-pdf {
    width: 100%;
    height: calc(100vh - 140px);
    min-height: calc(100vh - 140px);
    border: none;
}

/* Text Preview */
.preview-text-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #1e1e1e;
    padding: 1.5rem;
}

.preview-text {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Preview Button Styling */
.btn-preview {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.btn-preview:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
}

/* Desktop Navigation Buttons */
.preview-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    color: #4a5568;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-nav-btn:hover {
    background: #ffffff;
    color: #667eea;
    border-color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.preview-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.preview-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.preview-nav-btn:disabled:hover {
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #4a5568;
    border-color: #e2e8f0;
}

.preview-nav-prev {
    left: 1.5rem;
}

.preview-nav-next {
    right: 1.5rem;
}

/* Mobile Navigation Bar */
.preview-mobile-nav {
    display: none;
    justify-content: space-between;
    align-items: self-start;
    padding: 0.875rem 1rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    gap: 0.75rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    position: absolute;
    bottom: 0px;
    right: 0px;
    left: 0px;
    min-height: 120px;
}

.preview-mobile-nav-btn {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: #2b6cb0;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.preview-mobile-nav-btn:hover {
    background: #bee3f8;
    color: #2c5282;
    border-color: #63b3ed;
}

.preview-mobile-nav-btn:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.preview-mobile-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.preview-file-counter {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

/* Hide/show desktop vs mobile nav */
.desktop-only {
    display: flex !important;
}

.mobile-only {
    display: none !important;
}

/* Explicitly hide mobile navigation on desktop */
@media (min-width: 769px) {
    .preview-mobile-nav {
        display: none !important;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: flex !important;
    }
}

/* Mobile Responsive Preview */
@media (max-width: 768px) {
    /* Hide desktop navigation, show mobile navigation */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    .preview-header {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        min-height: 120px;
    }
    
    .preview-header h2 {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .preview-actions {
        gap: 0.5rem;
    }
    
    .preview-actions .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
        min-height: 40px;
        white-space: nowrap;
    }
    
    .preview-actions .btn i {
        font-size: 0.875rem;
    }
    
    .preview-close-btn {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
    
    .preview-content {
        min-height: calc(100vh - 240px);
        max-height: calc(100vh - 240px);
    }
    
    .preview-audio-container {
        padding: 2rem 1rem;
    }
    
    .preview-audio {
        max-width: 100%;
    }
    
    .preview-text-container {
        padding: 1rem;
    }
    
    .preview-text {
        font-size: 0.85rem;
    }
    
    .preview-loading {
        padding: 2rem 1.5rem;
        min-width: 180px;
    }
    
    .preview-loading i {
        font-size: 2rem;
    }
    
    .preview-loading .loading-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .preview-modal .modal-content {
        /* Support for iPhone notch and safe areas */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .preview-header {
        padding: 0.75rem;
        flex-wrap: nowrap;
    }
    
    .preview-header h2 {
        font-size: 0.85rem;
        padding-right: 0.5rem;
        line-height: 1.3;
    }
    
    .preview-actions {
        gap: 0.375rem;
        flex-wrap: nowrap;
    }
    
    .preview-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-height: 36px;
        gap: 0.375rem;
    }
    
    .preview-actions .btn i {
        font-size: 0.8rem;
    }
    
    .preview-actions .btn .btn-text-mobile {
        display: none;
    }
    
    .preview-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        padding: 0.25rem;
    }
    
    .preview-mobile-nav {
        padding: 0.75rem;
    }
    
    .preview-mobile-nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .preview-mobile-nav-btn span {
        display: none;
    }
    
    .preview-file-counter {
        font-size: 0.8rem;
        min-width: 50px;
    }
    
    .preview-image-container {
        padding: 0.5rem;
    }
    
    .preview-video-container {
        padding: 0;
    }
    
    .preview-text-container {
        padding: 0.75rem;
    }
    
    .preview-text {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    .preview-loading {
        padding: 1.5rem 1rem;
        min-width: 150px;
        gap: 1rem;
    }
    
    .preview-loading i {
        font-size: 1.75rem;
    }
    
    .preview-loading .loading-text {
        font-size: 0.85rem;
    }
}

/* Touch device optimizations for preview */
@media (hover: none) and (pointer: coarse) {
    .preview-close-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .preview-actions .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .preview-mobile-nav-btn {
        min-height: 48px;
    }
    
    .preview-close-btn:active {
        background: #e5e7eb;
    }
    
    .preview-actions .btn:active {
        opacity: 0.8;
    }
    
    .preview-mobile-nav-btn:active {
        transform: scale(0.95);
    }
}

/* Landscape mobile orientation for preview */
@media (max-width: 768px) and (orientation: landscape) {
    .preview-header {
        padding: 0.5rem 1rem;
    }
    
    .preview-header h2 {
        font-size: 0.85rem;
    }
    
    .preview-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    .preview-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .preview-mobile-nav {
        padding: 0.5rem 0.75rem;
    }
    
    .preview-mobile-nav-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    .preview-content {
        min-height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
}
