* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    color: white;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 3px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header h1 a {
    transition: opacity 0.3s ease;
}

.header h1 a:hover {
    opacity: 0.8;
}

.header p {
    font-size: 0.8rem;
    opacity: 0.9;
}

.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Upload Section */
.upload-section {
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed #667eea;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 8px;
}

.upload-content h3 {
    margin-bottom: 6px;
    color: #333;
    font-size: 1rem;
}

.upload-content p {
    color: #666;
    margin-bottom: 12px;
    font-size: 0.8rem;
    line-height: 1.3;
}

#fileInput {
    display: none;
}

.upload-options {
    margin-top: 12px;
}

.upload-options label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.upload-options textarea {
    width: 100%;
    padding: 6px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.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-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Progress Section */
.progress-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9ff;
    border-radius: 15px;
    border: 1px solid #e3e6f0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h3 {
    color: #667eea;
    font-size: 1.2rem;
    margin: 0;
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    background: white;
    padding: 5px 15px;
    border-radius: 20px;
    border: 2px solid #667eea;
    min-width: 70px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text-inside {
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    z-index: 1;
    position: relative;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.progress-details p {
    margin: 0;
}

.progress-speed {
    font-style: italic;
    color: #667eea;
}

/* Results Section */
.results-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
}

.file-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 5px;
    margin-bottom: 10px;
}

.file-info {
    display: flex;
    align-items: center;
}

.file-info i {
    margin-right: 10px;
    font-size: 1.2rem;
    color: #667eea;
}

.results-actions {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #c3e6cb;
}

.share-link {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9rem;
    margin-left: 10px;
}

/* Gallery Section */
.gallery-section {
    margin-top: 25px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-header h3 {
    color: #333;
    font-size: 1.1rem;
}

.gallery-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

#searchInput {
    padding: 6px 10px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    width: 180px;
    font-size: 0.85rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.gallery-item-preview {
    height: 120px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.gallery-item-preview:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.gallery-item-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.gallery-item-preview i {
    font-size: 2.5rem;
    color: #667eea;
}

.gallery-item-info {
    padding: 12px;
}

.gallery-item-title {
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
    font-size: 0.9rem;
}

.gallery-item-meta {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.gallery-item-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gallery-controls {
        justify-content: center;
    }
    
    #searchInput {
        width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}