/* 
 * Merge PDF Tool - Styles
 * Color Palette:
 * - Background: Black (#000000)
 * - Primary Red: #ef4444 (buttons)
 * - Highlight: #fbbf24 (bright yellow for important text)
 * - Text Primary: #ffffff (white)
 * - Text Secondary: #d1d5db (light gray)
 */

:root {
    --bg-black: #000000;
    --bg-dark: #111111;
    --bg-card: #1a1a1a;
    --primary-red: #ef4444;
    --primary-red-hover: #dc2626;
    --primary-red-light: rgba(239, 68, 68, 0.1);
    --highlight: #fbbf24;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border: #374151;
    --success: #10b981;
    --error: #ef4444;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Container */
.hojayfa-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Section Spacing */
hojayfa-section {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Required CSS Block 1: Header */
.hojayfa-ir-header1 {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    color: #f70c3f;
}

.hojayfa-ir-header1 h1 {
    font-size: 22px;
    font-weight: 700;
    color: #f70c3f;
    margin-bottom: 0.5rem;
}

/* Required CSS Block 2: Upload Border */
.hojayfa-upload-area {
    border: 3px dashed rgba(239, 68, 68, 0.5);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.hojayfa-upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hojayfa-upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.hojayfa-upload-subtext {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hojayfa-formats-text {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hojayfa-highlight {
    color: var(--highlight);
    font-weight: 600;
}

/* Buttons */
.hojayfa-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.hojayfa-btn-primary {
    background-color: var(--primary-red);
    color: var(--text-primary);
}

.hojayfa-btn-primary:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.hojayfa-btn-primary:active {
    transform: translateY(0);
}

.hojayfa-btn-primary:disabled {
    background-color: #6b7280;
    cursor: not-allowed;
    transform: none;
}

.hojayfa-btn-secondary {
    background-color: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.hojayfa-btn-secondary:hover {
    background-color: var(--primary-red);
    color: var(--text-primary);
}

.hojayfa-btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    margin-bottom: 1rem;
}

/* Section Titles */
.hojayfa-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 0.5rem;
}

/* Settings Grid */
.hojayfa-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hojayfa-setting-item {
    display: flex;
    flex-direction: column;
}

.hojayfa-setting-item.hojayfa-full-width {
    grid-column: 1 / -1;
}

.hojayfa-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.hojayfa-select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.hojayfa-select:focus {
    outline: none;
    border-color: var(--primary-red);
}

/* Custom Size Inputs */
.hojayfa-custom-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hojayfa-custom-inputs input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-size: 1rem;
}

.hojayfa-custom-inputs input:focus {
    outline: none;
    border-color: var(--primary-red);
}

/* Slider */
.hojayfa-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.hojayfa-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-red);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hojayfa-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--primary-red);
}

.hojayfa-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-red);
    cursor: pointer;
    border: none;
}

/* Checkbox */
.hojayfa-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.hojayfa-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-red);
}

/* File List */
.hojayfa-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.hojayfa-files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hojayfa-files-empty,
.hojayfa-preview-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

.hojayfa-file-item {
    background-color: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: move;
}

.hojayfa-file-item:hover {
    border-color: var(--primary-red);
    transform: translateX(5px);
}

.hojayfa-file-item.hojayfa-dragging {
    opacity: 0.5;
}

.hojayfa-file-drag-handle {
    font-size: 1.5rem;
    cursor: grab;
    color: var(--text-muted);
}

.hojayfa-file-drag-handle:active {
    cursor: grabbing;
}

.hojayfa-file-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.hojayfa-file-info {
    flex: 1;
    min-width: 0;
}

.hojayfa-file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.hojayfa-file-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.hojayfa-file-size,
.hojayfa-file-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hojayfa-file-actions {
    display: flex;
    gap: 0.5rem;
}

.hojayfa-file-remove {
    background-color: var(--primary-red);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.hojayfa-file-remove:hover {
    background-color: var(--primary-red-hover);
    transform: scale(1.05);
}

/* File Progress Bar */
.hojayfa-file-progress {
    margin-top: 0.5rem;
    height: 4px;
    background-color: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.hojayfa-file-progress-fill {
    height: 100%;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
}

/* Overall Progress */
.hojayfa-progress-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background-color: var(--bg-card);
    border: 2px solid var(--primary-red);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.hojayfa-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.hojayfa-progress-label {
    font-weight: 600;
    color: var(--text-primary);
}

.hojayfa-progress-percent {
    font-weight: 700;
    color: var(--highlight);
    font-size: 1.1rem;
}

.hojayfa-progress-bar {
    height: 12px;
    background-color: var(--bg-dark);
    border-radius: 6px;
    overflow: hidden;
}

.hojayfa-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), #f97316);
    transition: width 0.3s ease;
    border-radius: 6px;
}

/* Preview Section */
.hojayfa-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 8px;
}

.hojayfa-preview-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hojayfa-preview-item:hover {
    border-color: var(--primary-red);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.hojayfa-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hojayfa-preview-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
}

/* Modal */
.hojayfa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.hojayfa-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.hojayfa-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    border: 2px solid var(--primary-red);
}

.hojayfa-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background-color: var(--primary-red);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hojayfa-modal-close:hover {
    background-color: var(--primary-red-hover);
    transform: scale(1.1);
}

/* Download Section */
.hojayfa-download-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .hojayfa-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .hojayfa-ir-header1 h1 {
        font-size: 18px;
    }

    .hojayfa-section-title {
        font-size: 1.25rem;
    }

    .hojayfa-settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hojayfa-upload-area {
        padding: 2rem 1rem;
    }

    .hojayfa-upload-icon {
        font-size: 3rem;
    }

    .hojayfa-files-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hojayfa-file-item {
        flex-wrap: wrap;
    }

    .hojayfa-file-details {
        font-size: 0.8rem;
    }

    .hojayfa-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        max-height: 300px;
    }

    .hojayfa-progress-container {
        width: 95%;
        padding: 1rem;
    }

    .hojayfa-btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hojayfa-file-item {
        padding: 0.75rem;
    }

    .hojayfa-file-icon {
        font-size: 1.5rem;
    }

    .hojayfa-file-drag-handle {
        font-size: 1.25rem;
    }

    .hojayfa-btn-large {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }
}

/* Accessibility */
.hojayfa-btn:focus,
.hojayfa-select:focus,
.hojayfa-checkbox:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Animations */
@keyframes hojayfa-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hojayfa-file-item,
.hojayfa-preview-item {
    animation: hojayfa-fadeIn 0.3s ease;
}