/* ========== FRONTEND FORM STYLES ========== */

.aipig-frontend-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.aipig-frontend-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.aipig-frontend-title {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin: 0 0 30px 0;
    font-weight: 700;
}

.aipig-frontend-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.aipig-form-group {
    display: flex;
    flex-direction: column;
}

.aipig-label {
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
    font-size: 15px;
}

/* Upload Area */
.aipig-upload-area {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.aipig-upload-area:hover {
    border-color: #0073aa;
    background: #f0f6fc;
}

.aipig-upload-area.dragover {
    border-color: #0073aa;
    background: #e3f2fd;
    transform: scale(1.02);
}

.aipig-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.aipig-upload-placeholder svg {
    color: #0073aa;
}

.aipig-upload-placeholder p {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.aipig-file-types {
    font-size: 13px;
    color: #666;
}

.aipig-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}

.aipig-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Select Inputs */
.aipig-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.aipig-select:focus {
    outline: none;
    border-color: #0073aa;
}

/* Submit Button */
.aipig-submit-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.aipig-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.4);
}

.aipig-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading State */
.aipig-loading {
    text-align: center;
    padding: 30px;
    background: #f0f6fc;
    border-radius: 8px;
    border: 2px solid #0073aa;
}

.aipig-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid #e3f2fd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.aipig-loading p {
    margin: 0;
    color: #0073aa;
    font-weight: 500;
}

/* Result Display */
.aipig-result-success {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.aipig-result-success h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.aipig-result-image {
    margin: 20px 0;
}

.aipig-result-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.aipig-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.aipig-download-btn,
.aipig-generate-another {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.aipig-download-btn {
    background: #10b981;
    color: white;
    border: none;
}

.aipig-download-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.aipig-generate-another {
    background: white;
    color: #0073aa;
    border: 2px solid #0073aa;
}

.aipig-generate-another:hover {
    background: #0073aa;
    color: white;
}

/* Error Display */
.aipig-error {
    display: none;
}

.aipig-error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fee;
    border: 2px solid #dc3545;
    border-radius: 8px;
    color: #721c24;
    font-weight: 500;
}

.aipig-error-message svg {
    flex-shrink: 0;
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aipig-frontend-container {
        padding: 25px 20px;
    }
    
    .aipig-frontend-title {
        font-size: 24px;
    }
    
    .aipig-upload-area {
        padding: 30px 15px;
    }
    
    .aipig-result-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aipig-download-btn,
    .aipig-generate-another {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .aipig-frontend-wrapper {
        padding: 0 15px;
    }
    
    .aipig-frontend-container {
        padding: 20px 15px;
    }
    
    .aipig-frontend-title {
        font-size: 20px;
    }
    
    .aipig-submit-btn {
        font-size: 16px;
        padding: 14px 24px;
    }
}