* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content h1 {
    font-size: 1.3rem;
    color: #333;
}

.subtitle {
    color: #666;
    font-size: 0.85rem;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stats-badge {
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #666;
}

/* Main */
main {
    padding: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

/* Form */
.form-row {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #555;
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.8rem;
    color: #999;
}

/* Selected Files */
.selected-files {
    margin-top: 12px;
}

.selected-files-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.total-size {
    color: #666;
}

.selected-files-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
}

.selected-file-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.selected-file-item:last-child {
    border-bottom: none;
}

.file-icon {
    margin-right: 8px;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #888;
    margin: 0 10px;
    font-size: 0.8rem;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

/* Upload Actions */
.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* Upload Status */
.upload-status {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.upload-status:empty {
    display: none;
}

.upload-status.loading {
    background: #fff3cd;
    color: #856404;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
}

.upload-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Browser Section */
.browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.browser-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.browser-actions {
    display: flex;
    gap: 8px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.breadcrumb-item {
    color: #667eea;
    cursor: pointer;
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

/* File Browser */
.file-browser {
    border: 1px solid #eee;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-item.directory {
    font-weight: 500;
}

.file-item .file-icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.file-item .file-name {
    flex: 1;
}

.file-item .file-size {
    color: #888;
    font-size: 0.8rem;
    margin-right: 10px;
    min-width: 60px;
    text-align: right;
}

.file-item .file-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 350px;
}

.modal-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    border-radius: 10px 10px 0 0;
}

.modal-header h3 {
    font-size: 1rem;
    color: #333;
}

.modal-body {
    padding: 15px;
    font-size: 0.9rem;
}

.modal-actions {
    padding: 12px 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-actions {
        flex-direction: column;
        gap: 8px;
    }

    main {
        padding: 10px;
    }

    .card {
        padding: 12px;
    }

    .upload-area {
        padding: 20px;
    }

    .browser-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
