:root {
    --primary: #40a7e3;
    --primary-hover: #2e96d2;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --telegram-bg: #f5f5f5;
    --telegram-primary: #0088cc;
    --telegram-secondary: #a8a8a8;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}
button#it_resize_browse {
    max-width: 300px;
    margin: 0 auto 16px;
    display: block;
}


.it-resize-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* background-color: var(--telegram-bg); */
    padding: 1rem;
    max-width: 980px;
    margin: 0 auto;
    margin-bottom: 25px;
}

.image-tools-container {
    background: white !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    padding: 1.5rem !important;
    margin: 0 auto 30px !important;
}

.image-tools-container h3 {
    color: var(--telegram-primary);
    text-align: center;
    margin-bottom: 1.25rem !important;
    font-weight: 600;
    font-size: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.entry-content-wrap {
    padding: 0.5rem 1.5rem;
}

.it-upload-area--resize {
    background: white;
    border: 2px dashed #009d10 !important;
    border-radius: var(--border-radius) !important;
    padding: 2rem 1.5rem !important;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 1.25rem !important;
    margin: 0 auto;
    max-width: 650px;
}

.it-upload-area--resize:hover, .it-upload-area--resize.dragover {
    border-color: var(--telegram-primary) !important;
    background-color: rgba(0, 136, 204, 0.05) !important;
}

.it-upload-area--resize .fa-cloud-arrow-up {
    font-size: 2.5rem;
    color: var(--telegram-secondary);
    margin-bottom: 0.75rem;
}

.it-upload-area--resize > div:nth-child(2) {
    color: #334155;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.it-upload-area--resize > div:nth-child(3) {
    color: var(--telegram-secondary);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

#it_supported_formats {
    margin-top: 12px;
    font-size: 12px !important;
    color: #6b7280 !important;
    text-align: center;
    line-height: 1.4;
}

.pure-button {
    padding: 0.6rem 1.2rem !important;
    border: none !important;
    border-radius: var(--border-radius) !important;
    cursor: pointer;
    font-weight: 600 !important;
    transition: var(--transition) !important;
    font-size: 0.9rem !important;
}

.pure-button-primary {
    background-color: var(--telegram-primary) !important;
    color: white !important;
}

.pure-button-primary:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-2px);
}

.pure-button-secondary {
    background-color: var(--telegram-bg) !important;
    color: #2a1717 !important;
}

.pure-button-secondary:hover {
    background-color: #5a6268 !important;
    color: white !important;
}

.it-options-panel {
    background: white !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    padding: 1.5rem !important;
    margin-top: 1.5rem !important;
    animation: fadeIn 0.5s ease;
    max-width: 550px;
    margin: 5px auto;
}

.it-options-panel h4 {
    color: var(--telegram-primary);
    font-size: 1rem;
    margin: 0 0 1.25rem 0 !important;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.it-resize-toggle {
    display: flex;
    margin-bottom: 0.75rem;
    background: var(--light);
    border-radius: 50px;
    padding: 3px;
}

.it-resize-toggle .pure-button {
    flex: 1;
    text-align: center;
    padding: 0.4rem !important;
    border-radius: 50px !important;
    font-size: 0.85rem !important;
    background: transparent !important;
    color: var(--secondary) !important;
}

.it-resize-toggle .it-active {
    background: var(--telegram-primary) !important;
    color: white !important;
}

.it-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.it-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.it-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.it-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.it-switch input:checked + .slider {
    background-color: var(--telegram-primary);
}

.it-switch input:checked + .slider:before {
    transform: translateX(20px);
}
/* Slider container */
.it-slider-container {
    width: 100%;
    margin-top: 16px !important;
}

/* Hide default appearance */
.it-slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    transition: background 0.3s ease;
    cursor: pointer;
}

/* Thumb */
.it-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--info);
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background 0.3s ease, transform 0.2s ease;
}

.it-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--telegram-primary);
    transform: scale(1.1);
}

/* Firefox */
.it-slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--info);
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background 0.3s ease, transform 0.2s ease;
}

/* Track hover */
.it-slider-container input[type="range"]:hover {
    background: #d0d0d0;
}

/* Optional: Active filled track using background gradient */
.it-slider-container input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--info) 0%, #e0e0e0 0%);
}

.it-slider-container input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
}


.pure-input-1 {
    width: 100%;
    padding: 12px 14px !important;
    border: 1px solid #d0d7de !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    transition: all 0.25s ease !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.pure-input-1:focus {
    border-color: var(--telegram-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.2) !important;
    outline: none;
}

.pure-input-1::placeholder {
    color: #9aa0a6;
    font-style: italic;
}

#it_resize_width, #it_resize_height {
    color: red;
    font-weight: 600; height: 42px;
}

#it_resize_unit {
    color: #333; height: 42px; padding: 6px 15px !important;
}


.it-percent {
    width: 100%;
    padding: 0.4rem !important;
    text-align: center;
    background: var(--light) !important;
    border-radius: var(--border-radius) !important;
    font-size: 0.85rem !important;
    color: var(--secondary) !important;
    border: none !important;
}

.it-percent.it-active {
    background: var(--info) !important;
    color: white !important;
}

#it_custom_percent {
    width: 100%;
    margin: 8px 0;
    accent-color: var(--info);
}

.it-format {
    width: 100%;
    padding: 0.3rem 0.6rem !important;
    background: #e9ecef !important;
    border: none !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    color: var(--secondary) !important;
}

.it-format.it-active {
    background: var(--success) !important;
    color: white !important;
}

.it-results {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.it-results h4 {
    color: var(--telegram-primary);
    margin: 0 0 1.25rem 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2rem;
}

.it-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
    width: 100%;
    justify-content: center;
}

/* Mobile view - 2 images per line */
@media (max-width: 768px) {
    .it-thumbnails {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.it-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    width: 100%;
    max-width: 150px;
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.it-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.it-thumbnail-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

#it_resize_results_list {
    max-height: 600px;
    overflow-y: auto;
    margin-bottom: 16px;
    width: 100%;
    padding: 8px;
}

.it-result-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    gap: 0.8rem;
}

.it-result-img {
    flex: 0 0 100px;
    height: 100px;
}

.it-result-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.it-result-info {
    flex: 1;
    min-width: 0;
}

.it-result-name {
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
    word-wrap: break-word;
    font-weight: 600;
}

.it-result-details {
    font-size: 0.8rem;
    color: #777;
    line-height: 1.4;
}

.it-download-btn {
    padding: 0.5rem 0.9rem;
    background-color: var(--telegram-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
    max-width: 160px;
    margin: 0 auto;
}

.it-download-btn:hover {
    background-color: var(--primary-hover);
}


/* Output Format Buttons Wrapper */
.it-format-wrapper {
    display: flex;
    gap: 8px;              /* spacing between buttons */
    flex-wrap: nowrap;      /* keep all buttons in single line */
    justify-content: flex-start; /* left-align */
    margin-top: 6px;
}

.it-format-wrapper button {
    flex: 1;               /* equal width buttons */
    min-width: 60px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.it-format-wrapper button.it-active {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.it-format-wrapper button:hover {
    background-color: #eaeaea;
}

.it-dimension-inputs {
    display: flex;
    gap: 12px;          /* space between width & height */
    flex-wrap: wrap;    /* wraps on very small screens */
    margin-top: 6px;
}

.it-dimension-inputs .dimension-field {
    flex: 1;            /* each input takes equal width */
    display: flex;
    flex-direction: column;
}

.it-dimension-inputs label {
    margin-bottom: 4px;
    font-size: 13px;
    color: #475569;
}

.it-dimension-inputs input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    font-size: 14px;
}

.it-percent-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 buttons per row */
    gap: 8px;                              /* spacing between buttons */
    margin-top: 6px;
}

.it-percent-wrapper button {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    width: 100%; /* fill the grid column */
}

.it-percent-wrapper button.it-active {
    background-color: var(--info);
    color: white;
    border-color: var(--info);
}

.it-percent-wrapper button:hover {
    background-color: #eaeaea;
}
.it-action-buttons {
    display: flex;
    justify-content: center; /* center horizontally */
    gap: 12px;               /* space between buttons */
    margin-top: 22px;        /* top padding from previous section */
    flex-wrap: wrap;          /* wrap on small screens */
}

.it-action-buttons button {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.it-action-buttons button.pure-button-primary {
    background-color: var(--telegram-primary);
    color: white;
    border: none;
}

.it-action-buttons button.pure-button-primary:hover {
    background-color: var(--primary-hover);
}

.it-action-buttons button.pure-button-secondary {
    background-color: var(--light);
    color: #333;
    border: 1px solid #ccc;
}

.it-action-buttons button.pure-button-secondary:hover {
    background-color: #ccc;
}
/* Updated thumbnail styling */
.it-resize-thumb-inner {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    width: 140px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: inline-block;
    margin: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    background: white;
    transition: all 0.3s ease;
}

.it-resize-thumb-inner:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Thumbnail header with remove button */
.it-thumbnail-header {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 10;
}

.it-remove-thumb {
    background: #6b7280;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8; float:right
}

.it-remove-thumb:hover {
    background: #4b5563;
    transform: scale(1.1);
    opacity: 1;
}

/* Thumbnail image container */
.it-resize-thumb-inner > div:first-of-type {
    width: 100px;
    height: 100px;
    overflow: hidden;
    margin: 0 auto 8px;
    border-radius: 4px;
}

.it-resize-thumb-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Thumbnail file name */
.it-thumbnail-name {
    font-size: 11px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    line-height: 1.3;
    word-wrap: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Thumbnail details */
.it-thumbnail-details {
    font-size: 10px;
    color: #718096;
    line-height: 1.2;
}
/* Updated result item styling */
.it-resize-result-item {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    max-width: 600px;
    margin: 12px auto;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.it-result-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.it-result-image {
    flex: 0 0 120px;
}

.it-result-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    max-height: 110px;
}

.it-result-info {
    flex: 1;
    min-width: 0;
}

.it-result-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.it-result-original {
    font-size: 12px;
    color: #718096;
    margin-bottom: 4px;
    line-height: 1.3;
}

.it-result-resized {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
    line-height: 1.3;
}

.it-result-actions {
    flex: 0 0 auto;
    margin-top: 8px;
}

.it-download-single {
    padding: 8px 16px;
    font-size: 12px;
}

/* Mobile view for result panel - single image per row */
@media (max-width: 768px) {
    .it-resize-result-item {
        max-width: 100%;
        margin: 8px 0;
        padding: 12px;
    }
    
    .it-result-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .it-result-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .it-result-info {
        width: 100%;
    }
    
    .it-result-name {
        white-space: normal;
        text-overflow: unset;
        overflow: visible;
    }
    
    .it-result-actions {
        width: 100%;
        margin-top: 12px;
    }
    
    .it-download-single {
        width: 100%;
        max-width: 200px;
    }
	.it-result-image img {
		max-height: 140px;
	}
	.pure-g.it-format-wrapper {
    flex-direction: row;
    margin: auto 20px;
}
}
.pure-u-1.pure-u-sm-1-2.pure-u-md-1-4 {
    width: 206px;
    display: inline-grid;
     margin: auto;
;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .it-resize-container {
        padding: 0.5rem;
    }
    
    .image-tools-container {
        padding: 1rem !important;
    }
    
    .it-thumbnails {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .it-thumbnail {
        max-width: 130px;
    }
    
    .it-result-item {
        flex-direction: column;
        text-align: center;
        padding: 0.8rem;
    }
    
    .it-result-img {
        margin-bottom: 0.5rem;
    }
    
    .pure-g {
        flex-direction: column;
    }
	.pure-g.it-dimension-inputs{
		        flex-direction: row;
        margin: auto;
	}
    
    .pure-u-1-2, .pure-u-1-3, .pure-u-1-4, .pure-u-1-6 {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .image-tools-container h3 {
        font-size: 1.3rem;
    }
    
    .it-upload-area--resize {
        padding: 1.5rem 1rem !important;
    }
    
    .it-options-panel {
        padding: 1rem !important;
    }
}
 