/**
 * Frontend Styles for WordPress Image to PDF Converter
 */

.wp-image-to-pdf-frontend {
    max-width: 800px;
    margin: 20px 0;
    padding: 25px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-family: inherit;
}

/* Title */
.converter-title {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
}

/* Step Indicators */
.converter-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 20px;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.step.active {
    color: #0073aa;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #999;
    margin-right: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #0073aa;
    color: white;
    transform: scale(1.1);
}

.step-title {
    font-weight: 500;
}

/* Step Content */
.converter-step {
    min-height: 300px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.upload-drop-zone .upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.upload-drop-zone h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.upload-drop-zone p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 16px;
}

.upload-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 14px;
    color: #666;
}

.upload-info p {
    margin: 5px 0;
}

/* Images Preview */
.images-preview {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.images-preview h4 {
    margin-top: 0;
    color: #333;
}

.images-preview .description {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    font-size: 14px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.image-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: move;
    transition: all 0.2s ease;
    background: #fff;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.image-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #d63638;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.image-item .remove-btn:hover {
    background: #b32d2e;
}

/* PDF Options */
.pdf-options {
    margin-bottom: 25px;
}

.pdf-options h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.option-group select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.option-group select:focus {
    outline: none;
    border-color: #0073aa;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal !important;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: white;
}

.radio-option:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.radio-option input[type="radio"]:checked + span {
    color: #0073aa;
    font-weight: 600;
}

/* Step Actions */
.step-actions {
    margin-top: 25px;
    text-align: center;
}

.step-actions .button {
    margin: 0 5px;
    padding: 12px 24px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #f7f7f7;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.button:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.button-primary:hover {
    background: #005a87;
    border-color: #005a87;
    color: white;
}

/* Progress Bars */
.upload-progress,
.generation-progress {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    margin: 10px 0 0 0;
    color: #666;
    font-weight: 500;
}

/* Result Success */
.result-success {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.result-success h4 {
    margin: 0 0 20px 0;
    color: #2e7d32;
    font-size: 20px;
}

.result-info {
    margin: 15px 0;
    text-align: left;
    display: inline-block;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
}

.result-info p {
    margin: 5px 0;
    color: #333;
}

/* Error Messages */
.error-message {
    padding: 15px;
    background: #ffebee;
    border: 2px solid #f44336;
    border-radius: 6px;
    color: #c62828;
    margin-top: 20px;
    animation: slideIn 0.3s ease;
}

.error-message p {
    margin: 0;
    font-weight: 500;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sortable Placeholder */
.ui-sortable-placeholder {
    border: 2px dashed #0073aa;
    background: #f0f8ff;
    border-radius: 4px;
    height: 100px;
    visibility: visible !important;
}

/* Responsive Design */
@media (max-width: 600px) {
    .wp-image-to-pdf-frontend {
        padding: 15px;
        margin: 15px 0;
    }
    
    .converter-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .converter-steps {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .step {
        margin: 5px 0;
    }
    
    .upload-area {
        padding: 20px 15px;
    }
    
    .upload-drop-zone h4 {
        font-size: 18px;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .image-item img {
        height: 80px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .radio-option {
        justify-content: center;
    }
    
    .step-actions .button {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
    
    .result-info {
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .wp-image-to-pdf-frontend {
        padding: 10px;
        border-radius: 6px;
    }
    
    .converter-title {
        font-size: 20px;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .step-title {
        font-size: 12px;
    }
    
    .upload-area {
        padding: 15px 10px;
    }
    
    .upload-drop-zone .upload-icon {
        font-size: 36px;
    }
    
    .upload-drop-zone h4 {
        font-size: 16px;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .image-item img {
        height: 60px;
    }
    
    .image-item .remove-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wp-image-to-pdf-frontend {
        border-color: #000;
    }
    
    .upload-area,
    .option-group select,
    .radio-option {
        border-color: #000;
    }
    
    .button {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .button,
    .upload-area,
    .image-item,
    .step-number,
    .progress-fill {
        transition: none;
    }
    
    .upload-area:hover {
        transform: none;
    }
    
    .image-item:hover {
        transform: none;
    }
    
    .step.active .step-number {
        transform: none;
    }
    
    @keyframes slideIn,
    @keyframes fadeIn {
        from, to {
            opacity: 1;
            transform: none;
        }
    }
}