/* ============================================
   MAIN CONTAINER
   ============================================ */
.its-app {
    max-width: 1200px;
    margin: 20px auto;
    font-family: "Rubik", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   TOOL HEADER
   ============================================ */
.its-tool-header {
    margin-bottom: 25px;
}

.its-tool-title {
    color: #0B3454;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.its-tool-desc {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* ============================================
   OPTIONS PANEL
   ============================================ */
.its-options-panel {
    background: #f9f9f9;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-wrap: wrap;
    gap: 25px 40px;
}

.its-option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}

.its-option-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.its-range-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.its-range-wrapper input[type="range"] {
    flex: 1;
    max-width: 250px;
    height: 6px;
    -webkit-appearance: none;
    background: #49b1a3;
    border-radius: 3px;
    outline: none;
}

.its-range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #0B3454;
    border-radius: 50%;
    cursor: pointer;
}

.its-quality-value {
    font-weight: 600;
    color: #49b1a3;
    min-width: 45px;
}

.its-dimension-inputs {
    display: flex;
    gap: 15px;
}

.its-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.its-input-wrap label {
    font-weight: 400;
    font-size: 12px;
    color: #888;
}

.its-input-wrap input {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: "Rubik", sans-serif;
}

.its-options-panel select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: "Rubik", sans-serif;
    background: white;
}

/* Toggle Switch */
.its-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.its-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.its-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 26px;
}

.its-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.its-toggle input:checked + .its-toggle-slider {
    background-color: #49b1a3;
}

.its-toggle input:checked + .its-toggle-slider:before {
    transform: translateX(24px);
}

/* ============================================
   UPLOAD ZONE (Reused from your styles)
   ============================================ */
.its-upload-zone {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 15rem !important;
    border: 2.5px dashed #49b1a3 !important;
    border-radius: 0.5rem !important;
    background-color: rgba(73, 177, 163, 0.2) !important;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.its-upload-zone .its-file-input {
    opacity: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 10 !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
}

.its-upload-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0.5rem !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    background-color: #49b1a3 !important;
    height: 70px !important;
    padding-left: 4rem !important;
    padding-right: 4rem !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    font-weight: 700 !important;
    font-size: 22px !important;
    font-family: "Rubik", sans-serif;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.its-upload-icon {
    margin-right: 0.5rem !important;
    width: 2rem !important;
    height: 2rem !important;
}

.its-upload-text {
    color: #000000 !important;
    font-weight: 500 !important;
    padding-top: 1rem !important;
    font-family: "Rubik", sans-serif;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.its-upload-zone:hover {
    border-color: #0B3454 !important;
    background-color: rgba(11, 52, 84, 0.32) !important;
}

.its-upload-zone:hover .its-upload-btn {
    background-color: #0B3454 !important;
}

.its-upload-zone:hover .its-upload-text {
    color: #FFFFFF !important;
}

@media (max-width: 640px) {
    .its-upload-btn {
        height: 2.75rem !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        font-size: 0.875rem !important;
    }
}

/* ============================================
   FILE LIST WRAPPER
   ============================================ */
.its-file-list-wrapper {
    width: 100%;
    margin-top: 20px;
}

.its-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    width: 100%;
    margin-bottom: -1px;
    flex-wrap: wrap;
    gap: 10px;
}

.its-add-more-btn {
    display: inline-flex;
    align-items: center;
    background-color: #49b1a3;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    border: 1px solid #49b1a3;
    border-bottom: none;
    transition: background 0.2s;
    font-family: "Rubik", sans-serif;
}

.its-add-more-btn:hover {
    background: #0B3454;
    border-color: #0B3454;
}

.its-add-more-btn svg {
    margin-right: 8px;
}

.its-toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.its-total-count {
    color: #000000;
    font-size: 14px;
    font-weight: 700;
    font-family: "Rubik", sans-serif;
}

.its-count {
    color: #49b1a3;
}

.its-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #dc3545;
    font-weight: 600;
    font-size: 15px;
    font-family: "Rubik", sans-serif;
    cursor: pointer;
    padding: 8px 12px;
}

.its-clear-btn:hover {
    opacity: 0.8;
}

.its-process-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0B3454;
    color: #ffffff;
    border: none;
    font-weight: 600;
    font-size: 15px;
    font-family: "Rubik", sans-serif;
    padding: 12px 24px 12px 29px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 22px;
}

.its-process-btn:hover {
    background: #49b1a3;
}

.its-process-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   FILES CONTAINER
   ============================================ */
.its-files-container {
    background: #ffffff;
    border: 1px solid #49b1a3;
    border-radius: 0 12px 12px 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.its-files-container::-webkit-scrollbar {
    width: 8px;
}

.its-files-container::-webkit-scrollbar-track {
    background: transparent;
}

.its-files-container::-webkit-scrollbar-thumb {
    background-color: #49b1a3;
    border-radius: 10px;
}

.its-files-container::-webkit-scrollbar-thumb:hover {
    background-color: #389588;
}

.its-files-container {
    scrollbar-width: thin;
    scrollbar-color: #49b1a3 transparent;
}

/* File Item */
.its-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.its-file-item:last-child {
    border-bottom: none;
}

.its-file-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.its-file-thumb {
    width: 60px;
    height: 60px;
    border: 1px dashed #cccccc;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    flex-shrink: 0;
}

.its-file-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.its-file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.its-file-name {
    font-weight: 600;
    color: #495057;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.its-file-size {
    font-size: 12px;
    color: #888;
}

.its-file-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-pending {
    color: #ffc107;
}

.status-processing {
    color: #17a2b8;
    animation: pulse 1s infinite;
}

.status-success {
    color: #28a745;
}

.status-error {
    color: #dc3545;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.its-file-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.its-download-btn {
    background: #20c997;
    border: none;
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: "Rubik", sans-serif;
    text-decoration: none !important;
    gap: 6px;
    transition: background 0.2s;
}

.its-download-btn:hover {
    background: #1aa179;
    color: #ffffff !important;
}

.its-download-btn.show {
    display: inline-flex;
}

.its-remove-btn {
    background: transparent;
    border: none;
    color: #333333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    font-size: 20px;
    line-height: 1;
}

.its-remove-btn:hover {
    color: #dc3545;
}

/* ============================================
   RESULTS CONTAINER
   ============================================ */
.its-results-container {
    margin-top: 25px;
}

.its-results-wrapper {
    background: #fff;
    border: 2px solid #49b1a3;
    border-radius: 12px;
    padding: 25px;
}

.its-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.its-results-header h3 {
    color: #0B3454;
    font-size: 20px;
    margin: 0;
}

.its-download-all-btn {
    background: #49b1a3;
    color: #fff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    font-family: "Rubik", sans-serif;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.its-download-all-btn:hover {
    background: #0B3454;
    color: #fff !important;
}

.its-results-table {
    overflow-x: auto;
}

.its-results-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.its-results-table th {
    background: #f5f5f5;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.its-results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.its-results-table tr:hover {
    background: #f9f9f9;
}

.its-results-table .its-download-btn {
    display: inline-flex;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .its-options-panel {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .its-option-group {
        min-width: auto;
    }
    
    .its-dimension-inputs {
        flex-wrap: wrap;
    }
    
    .its-input-wrap input {
        width: 80px;
    }
    
    .its-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .its-add-more-btn {
        border-radius: 8px;
        justify-content: center;
    }
    
    .its-toolbar-right {
        justify-content: center;
        margin-bottom: 0;
        flex-wrap: wrap;
    }
    
    .its-file-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .its-file-left {
        flex: 1 1 100%;
    }
    
    .its-file-right {
        width: 100%;
        justify-content: flex-end;
    }
    
    .its-results-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .its-download-all-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .its-upload-btn {
        height: 50px !important;
        padding: 0 20px !important;
        font-size: 16px !important;
    }
    
    .its-upload-icon {
        width: 24px !important;
        height: 24px !important;
    }
    
    .its-upload-zone {
        height: 12rem !important;
    }
    
    .its-tool-title {
        font-size: 22px;
    }
}