* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.control-panel {
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.folder-section {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: #f8f9ff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.folder-section label {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

#folder-path {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#folder-path:focus {
    outline: none;
    border-color: #667eea;
}

.upload-section {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
    justify-content: start;
}

.upload-destination {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 1px solid #667eea;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.destination-icon {
    font-size: 18px;
}

.destination-text {
    color: #555;
}

.destination-text strong {
    color: #667eea;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #555;
    height: 44px;
    box-sizing: border-box;
}

.file-upload-label:hover {
    background: #ebebeb;
    border-color: #667eea;
}

.file-upload-label input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 20px;
}

.btn-primary, .btn-secondary {
    padding: 11px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    height: 44px;
    box-sizing: border-box;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-clear-folder {
    padding: 10px 12px;
    background: #fff;
    color: #999;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-clear-folder:hover {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.folders-list {
    margin-bottom: 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: #f8f9ff;
    padding: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.folders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.folders-search {
    margin-bottom: 12px;
}

#folder-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
}

#folder-search:focus {
    outline: none;
    border-color: #667eea;
}

.close-folders-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-folders-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.folders-container {
    max-height: 250px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.folder-item {
    padding: 10px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.folder-item:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateX(4px);
}

.folder-icon {
    font-size: 16px;
}

.folder-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.folder-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.stats {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    color: #666;
    padding: 12px 15px;
    background: #fafafa;
    border-radius: 6px;
    margin-top: 10px;
}

#file-count {
    font-weight: 500;
    color: #333;
}

#upload-status {
    font-weight: 500;
    color: #667eea;
}

.files-container {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.file-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
    transition: all 0.3s;
}

.file-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.file-preview {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #e0e0e0;
}

.file-info {
    margin-bottom: 10px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.file-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.status-uploading {
    background: #fff3cd;
    color: #856404;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.file-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
}

.link-label {
    font-weight: 500;
    color: #667eea;
    min-width: 60px;
}

.link-url {
    flex: 1;
    padding: 6px 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    padding: 4px 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #5568d3;
}

.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: #333;
    color: white;
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s;
    max-width: 300px;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

/* Scrollbar styling */
.files-container::-webkit-scrollbar {
    width: 8px;
}

.files-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.files-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.files-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    header h1 {
        font-size: 24px;
    }

    .control-panel {
        padding: 20px;
    }

    .folder-section {
        flex-direction: column;
        align-items: stretch;
    }

    .files-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .upload-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .folder-section label {
        width: 100%;
    }
    
    #folder-path {
        width: 100%;
    }

    .file-upload-label, .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .folders-container {
        grid-template-columns: 1fr;
    }
    
    .upload-destination {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}
