* {
    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;
    padding: 40px 20px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-area p {
    color: #666;
    margin-bottom: 15px;
}

.browse-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.browse-btn:hover {
    transform: scale(1.05);
}

.file-info {
    font-size: 0.85rem;
    color: #999;
    margin-top: 20px;
}

.preview-container {
    text-align: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.upload-progress {
    text-align: center;
    padding: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.success-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.success-content {
    text-align: center;
}

.success-content h2 {
    color: #28a745;
    margin-bottom: 30px;
}

.uploaded-image-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.link-container {
    margin-bottom: 30px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.link-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.link-box {
    display: flex;
    gap: 10px;
}

.link-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.gallery-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.gallery-section h2 {
    margin-bottom: 30px;
    color: #333;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-item .delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .delete-btn {
    opacity: 1;
}

footer {
    text-align: center;
    padding: 30px;
    color: white;
    opacity: 0.8;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.lightbox-caption {
    color: white;
    margin-top: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .upload-section,
    .gallery-section {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .link-box {
        flex-direction: column;
    }
}

/* Error state */
.error-message {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
}