/* Modern Mobile-Friendly File Manager Styles */

:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-light: #fff7ed;
    --bg-white: #ffffff;
    --border-color: #fed7aa;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background: linear-gradient(135deg, #fdba74 0%, #fb923c 50%, #ea580c 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

/* Sticky header group */
.sticky-header {
    flex-shrink: 0;
    z-index: 50;
    background: var(--bg-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Scrollable content area */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Custom scrollbar styling */
.scrollable-content::-webkit-scrollbar {
    width: 8px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Header */
.header {
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.search-box {
    flex: 1;
    max-width: 400px;
    min-width: 200px;
}

/* Toolbar */
.toolbar {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: white;
    background: var(--primary-color);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
}

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

.btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 1.5rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 14px;
}

.breadcrumbs strong {
    color: var(--text-light);
    margin-right: 0.5rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.breadcrumb-item:hover {
    background: var(--bg-light);
}

.breadcrumb-separator {
    color: var(--text-light);
    margin: 0 0.25rem;
}

/* Drag & Drop Upload Zone */
.upload-zone {
    margin: 1.5rem;
    padding: 3rem 1.5rem;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--bg-light);
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-zone-content {
    pointer-events: none;
}

.upload-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.upload-zone h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.upload-zone p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

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

/* Upload Progress */
.upload-progress {
    margin: 1.5rem;
    display: none;
}

.upload-progress.active {
    display: block;
}

.progress-item {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-item-name {
    font-weight: 500;
    color: var(--text-dark);
}

.progress-item-status {
    font-size: 13px;
    color: var(--text-light);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s;
}

/* File List */
.file-list-container {
    padding: 1.5rem;
}

.file-list {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.file-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto auto;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background 0.2s;
    cursor: pointer;
}

.file-item:hover {
    background: var(--bg-light);
}

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

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

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon img {
    width: 24px;
    height: 24px;
}

.file-info {
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    word-break: break-word;
}

.file-name:hover {
    color: var(--primary-color);
}

.file-comment {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 0.25rem;
    cursor: text;
}

.file-size, .file-date {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    padding: 0;
}

.action-btn:hover {
    background: var(--bg-light);
}

.action-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.action-btn:hover img {
    opacity: 1;
}

/* Feedback Messages */
.feedback {
    margin: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: none;
    animation: slideIn 0.3s ease-out;
}

.feedback.show {
    display: block;
}

.feedback.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.feedback.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Responsive Table View for Mobile */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .toolbar {
        padding: 0.75rem;
    }
    
    .breadcrumbs {
        padding: 0.75rem;
        font-size: 13px;
    }
    
    .upload-zone {
        margin: 1rem;
        padding: 2rem 1rem;
    }
    
    .file-list-container {
        padding: 0.75rem;
    }
    
    .file-item {
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .file-size,
    .file-date {
        display: none;
    }
    
    .file-actions {
        grid-column: 1 / -1;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
        justify-content: flex-end;
    }
    
    .modal-content {
        margin: 1rem;
    }
}

/* Small devices */
@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .file-item {
        grid-template-columns: auto 1fr;
    }
    
    .file-info {
        grid-column: 1 / -1;
    }
}

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

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

/* Print styles */
@media print {
    .toolbar,
    .search-box,
    .upload-zone,
    .file-actions {
        display: none;
    }
}

/* Touch-friendly sizing for mobile */
@media (hover: none) and (pointer: coarse) {
    .action-btn {
        width: 44px;
        height: 44px;
    }
    
    .btn {
        min-height: 44px;
    }
}
