/* Image Uploader Styles - Compact & Professional */
.image-uploader {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #4299e1;
    background: #ebf8ff;
}

.upload-area.drag-over {
    border-color: #3182ce;
    background: #bee3f8;
    transform: scale(1.02);
}

.upload-content {
    width: 100%;
}

.upload-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    color: #4299e1;
}

.upload-area h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: #2d3748;
    font-weight: 600;
}

.upload-area p {
    margin: 0 0 12px 0;
    color: #718096;
    font-size: 13px;
    line-height: 1.4;
}

.upload-area kbd {
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: monospace;
    color: #2d3748;
}

.upload-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.upload-button:active {
    transform: translateY(0);
}

.upload-progress {
    width: 100%;
    padding: 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    color: #4a5568;
    font-size: 12px;
    margin: 0;
}

.upload-error {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #fc8181;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.upload-result {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-preview {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.result-info {
    padding: 12px;
}

.result-info h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.url-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.url-box input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    color: #2d3748;
    font-family: monospace;
    background: #f7fafc;
}

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

.copy-button {
    background: #4299e1;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.copy-button svg {
    width: 16px;
    height: 16px;
}

.copy-button:hover {
    background: #3182ce;
}

.copy-button.copied {
    background: #48bb78;
}

.new-upload-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-upload-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .upload-area {
        padding: 20px 12px;
        min-height: 140px;
    }

    .upload-icon {
        width: 32px;
        height: 32px;
    }

    .upload-area h3 {
        font-size: 14px;
    }

    .upload-area p {
        font-size: 12px;
    }

    .result-info {
        padding: 12px;
    }
}

/* Gallery Toggle */
.gallery-toggle {
    margin-bottom: 20px;
}

.toggle-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.toggle-button:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Gallery View */
.gallery-view {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.gallery-header h3 {
    margin: 0;
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
}

.gallery-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gallery-search {
    padding: 8px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #2d3748;
    min-width: 200px;
}

.gallery-search:focus {
    outline: none;
    border-color: #667eea;
}

.gallery-action-btn {
    padding: 8px;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-action-btn:hover {
    background: #f56565;
}

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

.gallery-item {
    background: #f7fafc;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.gallery-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.gallery-item-preview {
    width: 100%;
    height: 120px;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

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

.gallery-item-name {
    font-size: 11px;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.gallery-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #718096;
    margin-bottom: 6px;
}

.gallery-copy-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-copy-btn:hover {
    background: #3182ce;
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 15px;
}

/* Upload Queue */
.upload-queue {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.queue-header h4 {
    margin: 0;
    font-size: 13px;
    color: #2d3748;
    font-weight: 600;
}

.clear-queue-btn {
    padding: 6px 12px;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-queue-btn:hover {
    background: #f56565;
}

.queue-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
}

.queue-item.pending {
    border-left-color: #ecc94b;
}

.queue-item.uploading {
    border-left-color: #4299e1;
}

.queue-item.success {
    border-left-color: #48bb78;
}

.queue-item.error {
    border-left-color: #fc8181;
}

.queue-item-icon {
    font-size: 18px;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-name {
    font-size: 12px;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-size {
    font-size: 10px;
    color: #718096;
}

.queue-item-status {
    display: flex;
    align-items: center;
}

.error-text {
    font-size: 10px;
    color: #fc8181;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Upload Results */
.upload-results {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.results-header {
    margin-bottom: 12px;
}

.results-header h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.action-btn.danger {
    background: #fc8181;
}

.action-btn.danger:hover {
    background: #f56565;
}

.results-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.result-item-preview {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.result-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.result-item-name {
    font-size: 12px;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-item-size {
    font-size: 10px;
    color: #718096;
}

.copy-formats {
    display: flex;
    gap: 4px;
    align-items: center;
}

.format-select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 11px;
    color: #2d3748;
    background: white;
    cursor: pointer;
}

.format-select:focus {
    outline: none;
    border-color: #667eea;
}

.copy-format-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-format-btn:hover {
    background: #3182ce;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .gallery-header {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-search {
        width: 100%;
        min-width: 0;
    }

    .result-item {
        flex-direction: column;
    }

    .result-item-preview {
        width: 100%;
        height: 150px;
    }

    .copy-formats {
        flex-direction: column;
        align-items: stretch;
    }

    .format-select,
    .copy-format-btn {
        width: 100%;
    }

    .results-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .upload-area {
        background: #1a202c;
        border-color: #4a5568;
    }

    .upload-area:hover {
        background: #2d3748;
        border-color: #4299e1;
    }

    .upload-area h3 {
        color: #e2e8f0;
    }

    .upload-area p {
        color: #a0aec0;
    }

    .upload-area kbd {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .progress-bar {
        background: #2d3748;
    }

    .progress-text {
        color: #cbd5e0;
    }

    .toggle-button,
    .gallery-view,
    .upload-queue,
    .upload-results {
        background: #2d3748;
        border-color: #4a5568;
    }

    .toggle-button {
        color: #cbd5e0;
    }

    .gallery-header h3,
    .queue-header h4,
    .results-header h4 {
        color: #e2e8f0;
    }

    .gallery-search,
    .format-select {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .gallery-item,
    .queue-item,
    .result-item {
        background: #1a202c;
        border-color: #4a5568;
    }

    .gallery-item-preview,
    .result-item-preview {
        background: #2d3748;
    }

    .gallery-item-name,
    .queue-item-name,
    .result-item-name {
        color: #e2e8f0;
    }

    .gallery-item-meta,
    .queue-item-size,
    .result-item-size {
        color: #a0aec0;
    }
}
