/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #1a202c;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #2d3748;
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.header h1 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 a:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header nav {
    text-align: center;
}

.header nav a {
    color: #4a5568;
    text-decoration: none;
    margin: 0 1.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid transparent;
}

.header nav a:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    color: #667eea;
}

/* Sección principal */
.main-section {
    padding: 3rem 0;
}

.upload-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.upload-section h2 {
    text-align: center;
    color: #2d3748;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Zona de subida */
.upload-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.15);
}

.upload-zone.dragover {
    border-color: #48bb78;
    background: rgba(72, 187, 120, 0.05);
    transform: scale(1.02);
    box-shadow: 0 16px 32px rgba(72, 187, 120, 0.2);
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon {
    color: #764ba2;
    transform: scale(1.1);
}

.upload-text {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
}

.upload-subtext {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.file-input {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    font-weight: 600;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

/* Resultado de subida */
.upload-result {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 16px;
    display: none;
}

.upload-result.success {
    background: rgba(72, 187, 120, 0.1);
    border: 2px solid #48bb78;
}

.upload-result.error {
    background: rgba(245, 101, 101, 0.1);
    border: 2px solid #f56565;
}

.result-preview {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-image {
    max-width: 300px;
    max-height: 200px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.result-info {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(45, 55, 72, 0.1);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.url-container {
    margin-top: 1rem;
}

.url-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: #f7fafc;
    margin-bottom: 0.5rem;
    transition: border-color 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: #667eea;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.copy-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Galería */
.gallery-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #764ba2, #667eea);
}

.gallery-section h2 {
    text-align: center;
    color: #2d3748;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.pagination-info {
    text-align: center;
    color: #718096;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.gallery-header {
    margin-bottom: 2rem;
}

.gallery-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.gallery-footer {
    margin-top: 2rem;
}

.gallery-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-meta {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.gallery-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.view-btn {
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    min-width: 80px;
    font-weight: 500;
}

.view-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.copy-link-btn {
    background: #764ba2;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 80px;
    font-weight: 500;
}

.copy-link-btn:hover {
    background: #6b46c1;
    transform: translateY(-1px);
}

/* Paginación */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pagination-btn {
    background: #ffffff;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pagination-btn:disabled {
    background: #f7fafc;
    color: #a0aec0;
    border-color: #e2e8f0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-dots {
    color: #a0aec0;
    padding: 0 0.5rem;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Loading y estados */
.loading {
    text-align: center;
    padding: 2rem;
    color: #718096;
    font-style: italic;
    font-size: 1.1rem;
}

.empty-gallery {
    text-align: center;
    padding: 3rem;
    color: #718096;
    font-size: 1.2rem;
}

.empty-gallery .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* Progress bar */
.progress-container {
    width: 100%;
    background: #e2e8f0;
    border-radius: 12px;
    margin: 1rem 0;
    overflow: hidden;
    display: none;
    height: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 12px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 3rem;
}

footer p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

footer p:last-child {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header nav a {
        margin: 0 0.5rem;
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .upload-section,
    .gallery-section {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .upload-text {
        font-size: 1.1rem;
    }
    
    .gallery-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .gallery-actions {
        flex-direction: column;
    }
    
    .view-btn,
    .copy-link-btn {
        flex: none;
    }
    
    .pagination-controls {
        gap: 0.3rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .upload-section h2,
    .gallery-section h2 {
        font-size: 1.8rem;
    }
    
    .gallery-images-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination-controls {
        justify-content: center;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeIn 0.5s ease-out;
}

/* Efectos adicionales */
.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.upload-zone:hover::before {
    left: 100%;
}

