/* Result display styles */
.result-section {
    margin-top: 30px;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    min-height: 100px;
    border: 1px solid var(--border-color);
}

.result-section img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: block;
}

.result-section img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.result-section video {
    max-width: 100%;
    width: 100%;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 18px;
    display: block;
}

.result-link {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.result-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.error-message {
    padding: 15px;
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
    border-radius: 10px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    margin-top: 15px;
}

.success-message {
    padding: 15px;
    background: rgba(40, 167, 69, 0.15);
    color: #51cf66;
    border-radius: 10px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    margin-top: 15px;
}

.info-message {
    padding: 15px;
    background: rgba(23, 162, 184, 0.15);
    color: #4dabf7;
    border-radius: 10px;
    border: 1px solid rgba(23, 162, 184, 0.3);
    margin-top: 15px;
    text-align: center;
    font-style: italic;
}

.progress-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
    border-radius: 15px;
}

#progressText {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
}

.status-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.status-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.status-value {
    color: var(--text-primary);
}

/* Image Gallery Styles */
.gallery-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.gallery-header h3 {
    color: var(--text-primary);
    font-size: 1.5em;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}

.gallery-item {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.gallery-video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    background: var(--bg-primary);
}

.video-item {
    position: relative;
}

.video-item::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 1;
    opacity: 0.9;
    transition: var(--transition);
}

.video-item:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.gallery-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.gallery-item:hover .gallery-item-actions {
    opacity: 1;
}

@media (max-width: 768px) {
    .gallery-item-actions {
        opacity: 1; /* Always visible on mobile */
        top: 8px;
        right: 8px;
        gap: 5px;
    }
}

.btn-gallery-select,
.btn-gallery-delete,
.btn-gallery-download {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-gallery-select:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-gallery-delete:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-gallery-download:hover {
    background: var(--success-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-gallery-select:active,
.btn-gallery-delete:active,
.btn-gallery-download:active {
    transform: scale(0.95);
}

.gallery-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

.gallery-badge.uploaded {
    background: #28a745;
}

.gallery-item-info {
    padding: 15px;
    background: var(--bg-tertiary);
}

.gallery-prompt {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-weight: 500;
    line-height: 1.4;
}

.gallery-item-info small {
    color: var(--text-muted);
    font-size: 12px;
}

.empty-gallery {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

/* Modal Styles */
.modal {
    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;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    object-fit: contain;
}

.modal-content p {
    margin-top: 18px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
}

.modal-content video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    background: var(--bg-primary);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 38px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

