.ic-converter-wrapper-v2 {
    max-width: 1000px;
    margin: 30px auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    background: #fff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    direction: rtl; /* RTL direction for the whole component */
}

/* --- Buttons --- */
.ic-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none; /* For <a> tags */
    gap: 8px; /* Space between icon and text */
    white-space: nowrap;
}
.ic-button svg {
    margin: 0;
}
.ic-button-primary {
    background-color: #4A90E2;
    color: #fff;
}
.ic-button-primary:hover {
    background-color: #357ABD;
}
.ic-button-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}
.ic-button-secondary:hover {
    background-color: #e5e7eb;
}
.ic-button-secondary.ic-active {
    background-color: #e5e7eb;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.ic-button-danger {
    background-color: #fef2f2;
    color: #ef4444;
}
.ic-button-danger:hover {
    background-color: #fee2e2;
}
.ic-button-success {
    background-color: #10b981;
    color: #fff;
}
.ic-button-success:hover {
    background-color: #059669;
}
.ic-button-success:disabled {
    background-color: #a7f3d0;
    cursor: not-allowed;
}
.ic-button-download {
    background-color: #4caf50;
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
}
.ic-button-download:hover {
    background: #45a049;
    transform: translateY(-2px);
}
.ic-button-download.ic-clicked {
    background: #6c757d;
    pointer-events: none;
    transform: translateY(0);
}
.ic-button-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}
.ic-button-remove:hover {
    color: #ef4444;
    background-color: #fef2f2;
}
/* v2.1: Per-row convert button */
.ic-button-convert-row {
    background-color: #4A90E2;
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    gap: 4px;
}
.ic-button-convert-row:hover {
    background-color: #357ABD;
}
.ic-format-select-row {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background-color: #fff;
}


/* --- Loader --- */
@keyframes ic-spinner-v2 {
    to {transform: rotate(360deg);}
}
.ic-loader-v2 {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ic-spinner-v2 .75s linear infinite;
    margin-left: 5px;
}
/* Special loader for download button */
.ic-button-download .ic-loader-v2 {
     margin-right: 5px;
     margin-left: 0;
}

/* --- Dropzone --- */
#ic-dropzone-v2 {
    display: flex; /* Hidden by default by JS */
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-bottom: 1px solid #e5e7eb;
}
.ic-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background-color: #f9fafb;
    text-align: center;
    width: 100%;
    transition: all 0.2s ease;
}
.ic-dropzone-content.ic-dragover {
    border-color: #4A90E2;
    background-color: #f0f5ff;
}
.ic-dropzone-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}
.ic-dropzone-content p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}
.ic-dropzone-content svg {
    color: #4A90E2;
}

/* --- Controls Bar --- */
.ic-controls-bar-v2 {
    display: none; /* Hidden by default */
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
.ic-converter-wrapper-v2.ic-queue-active .ic-controls-bar-v2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.ic-controls-left, .ic-controls-right {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* --- Settings Panel --- */
.ic-settings-panel-v2 {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}
.ic-settings-panel-v2 h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}
.ic-settings-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.ic-setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ic-setting-item label {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}
.ic-setting-item input[type="number"],
.ic-setting-item select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.ic-setting-item input[type="number"] {
    width: 70px;
}
.ic-setting-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* --- v2.1: Tooltip Styles --- */
.ic-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}
.ic-tooltip svg {
    color: #9ca3af;
}
.ic-tooltip .ic-tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #1f2937;
    color: #fff;
    text-align: right; /* RTL */
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 150%; /* Position above the icon */
    right: 50%; /* Center horizontally */
    transform: translateX(50%);
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 400;
}
.ic-tooltip .ic-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%; /* Arrow at the bottom */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}
.ic-tooltip:hover .ic-tooltip-text {
    visibility: visible;
    opacity: 1;
}


/* --- Queue Box --- */
.ic-queue-box-v2 {
    display: none; /* Hidden by default */
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}
.ic-converter-wrapper-v2.ic-queue-active .ic-queue-box-v2 {
    display: block;
}

/* --- File Row --- */
.ic-file-row-v2 {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px; /* v2.1: Added gap for spacing */
}
.ic-file-row-v2:last-child {
    border-bottom: none;
}

.ic-file-thumb-v2 {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow: hidden;
    flex-shrink: 0;
}
.ic-file-thumb-v2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ic-file-info-v2 {
    display: flex;
    flex-direction: column;
    /* margin-right: 12px; RTL - Replaced by gap */
    flex-grow: 1;
    min-width: 0; /* Important for flex truncation */
}
.ic-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ic-file-size {
    font-size: 13px;
    color: #6b7280;
}

.ic-file-status-v2 {
    /* v2.1: Adjusted width */
    flex-basis: 120px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    text-align: right; /* RTL */
    /* padding-left: 10px; RTL - Replaced by gap */
}
.ic-status.ic-status-ready { color: #6b7280; }
.ic-status.ic-status-processing { color: #3b82f6; display:flex; align-items:center; }
.ic-status.ic-status-success { color: #10b981; }
.ic-status.ic-status-error { color: #ef4444; }

.ic-file-actions-v2 {
    /* v2.1: Increased width for new controls */
    flex-basis: 320px;
    flex-shrink: 0;
    text-align: left; /* RTL */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
/* v2.1: Container for "ready" state buttons */
.ic-file-actions-ready {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* --- v2.2: Footer --- */
.ic-app-footer-v2 {
    display: none;
    text-align: left; /* In RTL, this aligns text to the "end" (left) */
    padding: 8px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
    color: #9ca3af;
}
.ic-converter-wrapper-v2.ic-queue-active .ic-app-footer-v2 {
    display: block; /* Show only when queue is active */
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .ic-controls-bar-v2 {
        flex-direction: column;
        align-items: stretch;
    }
    .ic-controls-left, .ic-controls-right {
        flex-direction: column;
    }
    .ic-file-row-v2 {
        flex-wrap: wrap;
        gap: 10px;
    }
    .ic-file-info-v2 {
        flex-basis: calc(100% - 62px); /* Full width minus thumb */
    }
    .ic-file-status-v2 {
        flex-basis: 100%;
        text-align: center;
        padding: 0;
        order: 3; /* Move status below info */
    }
    .ic-file-actions-v2 {
        flex-basis: 100%;
        order: 4; /* Move actions to the bottom */
    }
    .ic-file-actions-ready {
        flex-wrap: wrap;
        justify-content: center;
    }
    .ic-tooltip .ic-tooltip-text {
        /* Adjust tooltip for mobile */
        width: 250px;
        right: 0;
        transform: translateX(0);
    }
    .ic-tooltip .ic-tooltip-text::after {
        left: 85%; /* Reposition arrow */
    }
}