/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4285f4;
    color: white;
}

.btn-primary:hover {
    background: #3367d6;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-left: auto;
}

.view-toggle button {
    padding: 8px 15px;
    border: none;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.view-toggle button.active {
    background: #4285f4;
    color: white;
}

.view-toggle button:not(:last-child) {
    border-right: 1px solid #ddd;
}

#current-path {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    font-family: monospace;
    flex-grow: 1;
}

.main-area {
    display: flex;
    gap: 20px;
    min-height: 70vh;
}

.file-area {
    background: white;
    border-radius: 10px;
    padding: 20px;
    flex: 1;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.upload-area {
    background: white;
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Grid View */
.grid-view {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.grid-view .item {
    width: 120px;
    padding: 15px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.grid-view .item:hover {
    background: #f8f9fa;
    border-color: #4285f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.grid-view .item img {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.grid-view .item .name {
    font-size: 12px;
    word-break: break-all;
    color: #333;
}

/* List View */
.list-view {
    display: block;
}

.list-view .item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.list-view .item:hover {
    background: #f8f9fa;
    border-color: #4285f4;
}

.list-view .item img {
    width: 32px;
    height: 32px;
    margin-right: 15px;
}

.list-view .item-details {
    flex: 1;
}

.list-view .item-name {
    font-weight: 600;
    color: #333;
}

.list-view .item-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Drag and Drop States */
.item.dragging {
    opacity: 0.5;
    background: #e3f2fd !important;
}

.item.drag-over {
    background-color: #e8f4fe !important;
    border: 2px dashed #4285f4 !important;
}

#file-area.highlight {
    background-color: #f8fbff;
    border: 3px dashed #4285f4;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#file-area.highlight::before {
    content: "Drop files here";
    color: #4285f4;
    font-size: 18px;
    font-weight: 600;
}

/* Dropzone */
.dropzone {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    margin-bottom: 20px;
}

.dropzone:hover {
    border-color: #4285f4;
    background: #f0f7ff;
}

.dropzone.dragover {
    border-color: #4285f4;
    background: #e3f2fd;
}

.dropzone-icon {
    font-size: 48px;
    color: #4285f4;
    margin-bottom: 15px;
}

.dropzone-text {
    color: #666;
    margin-bottom: 10px;
}

.dropzone-hint {
    color: #999;
    font-size: 12px;
}

/* Progress Bar */
.upload-progress {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
    display: none;
}

.upload-progress::-webkit-progress-bar {
    background-color: #eee;
}

.upload-progress::-webkit-progress-value {
    background-color: #4285f4;
    transition: width 0.3s;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: #4285f4;
    cursor: pointer;
    text-decoration: none;
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #999;
}

/* Context Menu */
#custom-context-menu {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* File Icons */
.file-icon {
    filter: hue-rotate(0deg);
    transition: filter 0.3s;
}

.file-icon.image {
    filter: hue-rotate(120deg);
}

.file-icon.pdf {
    filter: hue-rotate(180deg);
}

.file-icon.word {
    filter: hue-rotate(240deg);
}

.file-icon.excel {
    filter: hue-rotate(300deg);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-area {
        flex-direction: column;
    }

    .upload-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        margin-left: 0;
        margin-top: 10px;
    }

    .grid-view .item {
        width: calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .grid-view .item {
        width: 100%;
    }

    .container {
        padding: 10px;
    }
}
