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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e9ecef;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

.upload-btn, .create-folder-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.create-folder-btn {
    background: #17a2b8;
}

.create-folder-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

.folder-tree {
    margin-top: 20px;
}

.folder-item {
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.folder-item:hover {
    background: #f8f9fa;
}

.folder-item.active {
    background: #e3f2fd;
    color: #1976d2;
}

/* File Area */
.file-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.breadcrumb {
    font-size: 14px;
    color: #6c757d;
}

.breadcrumb span {
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 3px;
    transition: background 0.2s;
}

.breadcrumb span:hover {
    background: #f8f9fa;
    color: #495057;
}

.view-options {
    display: flex;
    gap: 5px;
}

.view-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #e9ecef;
}

.view-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.file-grid.list-view {
    grid-template-columns: 1fr;
    gap: 10px;
}

.file-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.file-grid.list-view .file-item {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 15px 20px;
}

.file-grid.list-view .file-item:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #6c757d;
}

.file-grid.list-view .file-icon {
    font-size: 24px;
    margin-right: 15px;
    margin-bottom: 0;
    min-width: 24px;
}

.file-name {
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
    word-break: break-word;
    line-height: 1.4;
}

.file-grid.list-view .file-name {
    flex: 1;
    margin-bottom: 0;
    margin-right: 15px;
}

.file-size {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.file-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 15px;
}

.file-grid.list-view .file-size,
.file-grid.list-view .file-date {
    margin-bottom: 0;
    margin-right: 15px;
    min-width: 80px;
}

.file-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.file-grid.list-view .file-actions {
    opacity: 1;
}

.file-actions button {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #6c757d;
}

.file-actions button:hover {
    background: #f8f9fa;
    color: #007bff;
}

.folder-item .file-actions button:hover {
    color: #ffc107;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 10px;
    font-size: 16px;
}

.empty-state p:last-child {
    font-size: 14px;
    opacity: 0.8;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading i {
    font-size: 24px;
    margin-right: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 8% auto;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    color: #495057;
    font-size: 1.25rem;
}

.close {
    color: #adb5bd;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #495057;
}

/* Drop Zone */
.drop-zone {
    margin: 30px;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: scale(1.02);
}

.drop-zone i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.drop-zone:hover i,
.drop-zone.dragover i {
    color: #007bff;
}

.drop-zone p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

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

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

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.modal-actions {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-left: 4px solid #007bff;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

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

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

.notification.error {
    border-left-color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
}

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

.notification i {
    font-size: 18px;
}

.notification.success i {
    color: #28a745;
}

.notification.error i {
    color: #dc3545;
}

.notification.warning i {
    color: #ffc107;
}

.notification.info i {
    color: #17a2b8;
}

.notification span {
    flex: 1;
    font-size: 14px;
    color: #495057;
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #adb5bd;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.2s;
}

.notification-close:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.auth-header h1 {
    color: #495057;
    margin-bottom: 10px;
}

.auth-header p {
    color: #6c757d;
    font-size: 14px;
}

.auth-form .form-group {
    margin: 0 0 20px 0;
}

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.auth-footer a {
    color: #007bff;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .view-options {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .file-area {
        padding: 15px;
    }
    
    .sidebar {
        padding: 15px;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .file-item {
        padding: 15px;
    }
    
    .file-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .notification-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}


/* Document Viewer Styles */
.document-viewer {
    z-index: 2000;
}

.document-viewer .modal-content {
    width: 95%;
    height: 95%;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
}

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

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.viewer-info h2 {
    margin: 0;
    font-size: 18px;
    color: #495057;
}

.file-info {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

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

.viewer-btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
}

.viewer-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.viewer-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
    overflow: auto;
}

.viewer-loading {
    text-align: center;
    color: #6c757d;
}

.viewer-loading i {
    font-size: 48px;
    margin-bottom: 20px;
}

.viewer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.viewer-pagination {
    display: flex;
    align-items: center;
    gap: 15px;
}

.viewer-pagination button {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.viewer-pagination button:hover:not(:disabled) {
    background: #e9ecef;
}

.viewer-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.viewer-zoom button {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.viewer-zoom button:hover {
    background: #e9ecef;
}

/* Document Display Styles */
.document-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-frame {
    max-width: 100%;
    max-height: 100%;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-viewer {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.text-viewer {
    width: 100%;
    height: 100%;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow: auto;
    background: white;
    color: #333;
}

.video-viewer {
    max-width: 100%;
    max-height: 100%;
}

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

.unsupported-file {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.unsupported-file i {
    font-size: 64px;
    margin-bottom: 20px;
}

.download-preview {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.download-preview i {
    font-size: 48px;
    color: #007bff;
    margin-bottom: 20px;
}

.download-preview h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.download-preview p {
    color: #6c757d;
    margin-bottom: 20px;
}

/* Search Container Styles */
.search-container {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.search-container button {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
}

.search-container button:hover {
    background: #5a6268;
}

/* File Details Modal */
.file-details {
    padding: 20px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.detail-value {
    color: #6c757d;
    word-break: break-all;
}

/* Responsive Design for Viewer */
@media (max-width: 768px) {
    .document-viewer .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .viewer-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .viewer-controls {
        justify-content: space-between;
    }
    
    .viewer-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .text-viewer {
        padding: 15px;
        font-size: 12px;
    }
}

/* File item hover effects for viewing */
.file-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.file-item:hover {
    transform: translateY(-2px);
}

.file-item.viewable {
    border: 2px solid transparent;
}

.file-item.viewable:hover {
    border-color: #007bff;
}

/* Fullscreen styles */
.viewer-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
}

.viewer-fullscreen .viewer-body {
    background: #000;
}

/* Loading states */
.viewer-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* File type indicators */
.file-item::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    display: none;
}

.file-item.viewable::after {
    display: block;
}


/* View button styles */
.file-item .view-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-item .view-btn:hover {
    background: #0056b3;
}

.file-item.viewable {
    position: relative;
}

.file-item.viewable::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
}

.file-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.file-actions button {
    padding: 4px 6px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.file-actions .view-btn {
    background: #17a2b8;
    color: white;
}

.file-actions .view-btn:hover {
    background: #138496;
}

/* Detail modal styles */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.detail-value {
    color: #6c757d;
    word-break: break-all;
    text-align: right;
}