/* Image Upload Section */
.image-upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    background: var(--secondary-bg);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area.drag-over {
    border-color: var(--accent-orange);
    background: rgba(255, 107, 53, 0.05);
    transform: scale(1.02);
}

.upload-area.has-image {
    border-style: solid;
    padding: 1rem;
}

.upload-content {
    width: 100%;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.upload-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.upload-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.upload-btn {
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    background: #FF8F65;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

/* Image Preview */
.image-preview {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.remove-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.remove-btn:hover {
    background: #F44336;
    transform: scale(1.1);
}

/* Examples Section */
.examples-section {
    margin-top: 4rem;
    padding: 3rem;
    background: var(--secondary-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.examples-section h3 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.example-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.example-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-orange);
}

.example-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.example-item h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.example-item p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Image-specific FAQ section */
.image-faq {
    margin-top: 3rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.image-faq h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Complete Guide for Images */
#complete-guide {
    margin-top: 3rem;
    padding: 3rem;
    background: var(--secondary-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

#complete-guide h2 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

/* Active nav state */
.nav-links a.active {
    color: var(--accent-orange);
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-orange);
}

/* File input states */
#imageInput:focus+.upload-content {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

/* Extract button specific to image page */
#extractImageBtn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-area {
        padding: 2rem;
        min-height: 250px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-content h4 {
        font-size: 1.1rem;
    }

    .examples-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .example-item {
        padding: 1rem;
    }

    .example-icon {
        font-size: 2rem;
    }

    .examples-section {
        padding: 2rem;
        margin-top: 2rem;
    }

    #complete-guide {
        padding: 2rem;
    }

    .image-preview img {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 1.5rem;
        min-height: 200px;
    }

    .upload-content p {
        font-size: 0.9rem;
    }

    .upload-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .example-item p {
        display: none;
        /* Hide descriptions on very small screens */
    }

    .remove-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    #extractImageBtn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* Drag and drop visual feedback */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

.upload-area.drag-over {
    animation: pulse 2s infinite;
}

/* Loading state for image processing */
.upload-area.processing {
    pointer-events: none;
    opacity: 0.7;
}

.upload-area.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .upload-area {
        border-width: 4px;
    }

    .remove-btn {
        background: #F44336;
    }
}

/* Reduced motion adjustments */
@media (prefers-reduced-motion: reduce) {
    .upload-area.drag-over {
        animation: none;
    }
}

/* Print styles */
@media print {

    .upload-area,
    .examples-section,
    .remove-btn {
        display: none;
    }
}