/* Image to PDF Converter Styles */

/* Variables based on user's scheme */
:root {
    --itp-text-main: #333;
    --itp-text-light: #666;
    --itp-heading-color: #2a7d8b;
    --itp-bg-color: #f8f9fa;
    --itp-card-bg: white;
    --itp-gradient: linear-gradient(90deg, #4CAF50, #2196F3);
    --itp-border-color: #ddd;
    --itp-active-border-color: #2196F3; /* Using one of the gradient colors for active state */
    --itp-active-bg: #e7f3ff; /* Light blue for active background */
}

.itp-converter-wrapper {
    background-color: var(--itp-bg-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: var(--itp-text-main);
    font-family: sans-serif; /* Basic font, WP theme might override */
    max-width: 900px; /* Limit max width */
    margin: 20px auto; /* Center the tool */
}

.itp-main-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.itp-upload-preview-area {
    flex: 1; /* Takes up available space */
    min-width: 300px; /* Minimum width before wrapping */
    background-color: var(--itp-card-bg);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--itp-border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.itp-conversion-options-area {
    flex: 0 0 300px; /* Fixed width for options, doesn't grow */
    background-color: var(--itp-card-bg);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--itp-border-color);
}

.itp-options-heading {
    color: var(--itp-heading-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
    text-align: center;
}

/* Buttons */
.itp-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    color: white;
    text-align: center;
}

.itp-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.itp-btn-select,
.itp-btn-convert {
    background: var(--itp-gradient);
    width: 100%; /* Make main buttons full width of their container */
    margin-bottom: 15px;
}

.itp-btn-convert {
    margin-top: 20px; /* Space above convert button */
}


/* Image Preview */
.itp-image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    max-height: 400px; /* Limit height and allow scrolling */
    overflow-y: auto;
    padding: 5px;
    border: 1px dashed var(--itp-border-color);
    min-height: 100px; /* Ensure drop area is visible */
    background-color: #fdfdfd;
}

.itp-preview-item {
    position: relative;
    border: 1px solid var(--itp-border-color);
    border-radius: 4px;
    overflow: hidden;
    height: 100px; /* Fixed height for previews */
}

.itp-preview-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, might crop */
}

.itp-remove-img-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
}
.itp-remove-img-btn:hover {
    background-color: rgba(255, 0, 0, 0.8);
}


/* Options Area Styling */
.itp-option-group {
    margin-bottom: 20px;
}

.itp-option-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--itp-text-light);
    font-size: 0.9em;
}

.itp-button-group {
    display: flex;
    gap: 10px;
}

.itp-option-btn {
    flex: 1; /* Distribute space evenly */
    padding: 10px;
    border: 1px solid var(--itp-border-color);
    border-radius: 4px;
    background-color: var(--itp-card-bg);
    color: var(--itp-text-light);
    cursor: pointer;
    text-align: center;
    font-size: 0.9em;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.itp-option-btn:hover {
    background-color: #f0f0f0;
}

.itp-option-btn.active {
    border-color: var(--itp-active-border-color);
    background-color: var(--itp-active-bg);
    color: var(--itp-active-border-color);
    font-weight: bold;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3); /* Subtle glow for active */
}

.itp-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--itp-border-color);
    border-radius: 4px;
    background-color: var(--itp-card-bg);
    color: var(--itp-text-main);
    font-size: 0.9em;
    box-sizing: border-box; /* Include padding and border in width */
}

.itp-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.itp-checkbox-group input[type="checkbox"] {
    margin: 0;
    accent-color: var(--itp-active-border-color); /* Style checkbox color */
}

.itp-checkbox-group label {
    margin-bottom: 0; /* Override default label margin */
    font-weight: normal;
    color: var(--itp-text-main);
}

#itpLoadingIndicator {
    color: var(--itp-text-light);
    font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .itp-main-container {
        flex-direction: column; /* Stack columns */
    }
    .itp-conversion-options-area {
        flex: 1; /* Allow options area to take full width */
        min-width: unset; /* Remove fixed width */
    }
}
