/* Modern, impressive design with animations and effects */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.logo {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid #e5e7eb;
}

.logo i {
    font-size: 2rem;
}

.nav-menu {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

/* Storage Info */
.storage-info {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.storage-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--gray);
}

.storage-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.storage-used {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.storage-text {
    font-size: 0.875rem;
    color: var(--gray);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: var(--light);
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.user-menu:hover {
    background: var(--light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--light);
}

/* File Grid */
.file-grid {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* File/Folder Items */
.file-item {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-item.folder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.file-icon {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
}

.file-icon i {
    font-size: 3rem;
    color: var(--primary);
}

.file-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-info {
    font-size: 0.75rem;
    color: var(--gray);
}

.file-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.action-btn {
    background: var(--white);
    border: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.action-btn:hover {
    background: var(--light);
}

/* Modals */
.modal {
    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;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* Upload Area */
.upload-area {
    border: 2px dashed #e5e7eb;
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-progress {
    margin-top: 1rem;
}

.upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.upload-item-progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-item-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Shared Users List */
.shared-users {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.shared-users h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.shared-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.shared-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shared-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.remove-access-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
}

.remove-access-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        position: fixed;
        z-index: 999;
    }
    
    .sidebar.active {
        width: 260px;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem;
    }
    
    .btn span {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item {
    animation: fadeIn 0.3s ease;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #111827;
        --white: #1f2937;
        --dark: #f9fafb;
        --gray: #9ca3af;
    }
    
    body {
        background: #030712;
    }
    
    .sidebar,
    .header,
    .file-item,
    .modal-content {
        background: var(--white);
        border-color: #374151;
    }
    
    .upload-area {
        border-color: #374151;
    }
    
    .form-group input {
        background: var(--light);
        border-color: #374151;
        color: var(--dark);
    }
}

/* Add these styles to your existing styles.css to fix the file display issues */

/* File grid layout fix */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

/* File item compact display */
.file-item {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 160px; /* Fixed height for consistent grid */
    overflow: hidden;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* File actions positioning */
.file-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--light);
    border-radius: 0.375rem;
    padding: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray);
    font-size: 0.875rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* File icon */
.file-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* File name with ellipsis */
.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.25rem;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* File info */
.file-info {
    font-size: 0.75rem;
    color: var(--gray);
}

/* Folder specific styling */
.file-item.folder .file-icon {
    color: #fbbf24;
}

/* Breadcrumb improvements */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.breadcrumb i.fa-home {
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb i.fa-home:hover {
    color: var(--primary);
}

.breadcrumb-link {
    cursor: pointer;
    transition: all 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Modal improvements */
.modal-large {
    max-width: 90%;
    width: 1000px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .file-item {
        height: 140px;
        padding: 0.75rem;
    }
    
    .file-icon {
        font-size: 2rem;
        height: 40px;
    }
    
    .file-icon img {
        width: 40px;
        height: 40px;
    }
}
/* Add these styles to your existing styles.css to fix the file display issues */

/* File grid layout fix */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1.5rem;
}

/* File item compact display */
.file-item {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 110px; /* Reduced height for more compact display */
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* File actions positioning */
.file-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--light);
    border-radius: 0.375rem;
    padding: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray);
    font-size: 0.875rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* File icon */
.file-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* File name with ellipsis */
.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.25rem;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* File info */
.file-info {
    font-size: 0.75rem;
    color: var(--gray);
}

/* Additional card styling */
.file-item.folder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.file-item.folder:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

/* Folder specific styling */
.file-item.folder .file-icon {
    color: #5e72e4;
    font-size: 2.25rem;
}

/* Breadcrumb improvements */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.breadcrumb i.fa-home {
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb i.fa-home:hover {
    color: var(--primary);
}

.breadcrumb-link {
    cursor: pointer;
    transition: all 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Modal improvements */
.modal-large {
    max-width: 90%;
    width: 1000px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .file-item {
        height: 100px;
        padding: 0.5rem;
    }
    
    .file-icon {
        font-size: 1.75rem;
        height: 32px;
    }
    
    .file-icon img {
        width: 32px;
        height: 32px;
    }
}