/* Image Tools Pro Styles */
.itp-container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.itp-header {
    background: linear-gradient(135deg, #0061ff, #60efff);
    color: white;
    padding: 20px;
    text-align: center;
}

.itp-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.itp-header p {
    font-size: 16px;
    opacity: 0.9;
}

.itp-upload-container {
    text-align: center;
    margin-bottom: 25px;
}

.itp-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0061ff, #60efff);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.itp-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.itp-upload-btn .dashicons {
    margin-right: 8px;
}

.itp-file-input {
    display: none;
}

.itp-loading {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin: 10px 0;
    display: none;
}

.itp-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0061ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: itp-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes itp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.itp-images {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding: 0 20px;
}

.itp-image-box {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.itp-image-box h3 {
    background: linear-gradient(135deg, #0061ff, #60efff);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.itp-image-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.itp-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.itp-size-info {
    text-align: center;
    margin: 10px 0 0 0;
    font-size: 14px;
    color: #6c757d;
}

.itp-controls {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 0 20px 20px;
}

.itp-control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.itp-control-row:last-child {
    margin-bottom: 0;
}

.itp-control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.itp-control-group label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.itp-control-group input[type="number"],
.itp-control-group select {
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.itp-control-group input[type="number"]:focus,
.itp-control-group select:focus {
    outline: none;
    border-color: #0061ff;
    box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.1);
}

.itp-quality-group {
    flex: 1;
    min-width: 200px;
}

.itp-format-group {
    flex: 1;
    min-width: 280px;
}

.itp-quality-group input[type="range"] {
    width: 100%;
}

#qualityValue {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #0061ff;
}

.itp-lock-btn {
    padding: 12px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 5px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.itp-lock-btn:hover {
    background: #dee2e6;
}

.itp-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-top: 25px;
}

.itp-checkbox-custom {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

#bwToggle:checked + .itp-checkbox-custom {
    background: #0061ff;
    border-color: #0061ff;
}

#bwToggle:checked + .itp-checkbox-custom::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#bwToggle {
    display: none;
}

.itp-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.itp-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.itp-btn-primary {
    background: linear-gradient(135deg, #0061ff, #60efff);
    color: white;
}

.itp-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.itp-btn-success {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: white;
}

.itp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.itp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Rotation controls */
.itp-rotation-group {
    flex: 1;
    min-width: 200px;
}

.itp-rotation-group input[type="range"] {
    width: 100%;
}

.itp-instructions {
    text-align: center;
    padding: 15px;
    color: #6c757d;
    font-size: 14px;
    border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .itp-images {
        flex-direction: column;
    }
    
    .itp-control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .itp-control-group {
        width: 100%;
    }
    
    .itp-lock-btn {
        align-self: center;
        margin: 5px 0;
    }
    
    .itp-buttons {
        grid-template-columns: 1fr;
    }
    
    .itp-image-wrapper {
        height: 250px;
    }
    
    .itp-format-group {
        min-width: 100%;
    }
}

/* Cropper.js Overrides */
.cropper-view-box,
.cropper-face {
    border-radius: 8px;
}

.cropper-modal {
    background: transparent;
}

.cropper-point {
    background-color: #0061ff;
}

.cropper-line {
    background-color: #0061ff;
    opacity: 0.3;
}

/* Performance optimizations */
.itp-container * {
    box-sizing: border-box;
}
.itp-container img {
    image-rendering: -webkit-optimize-contrast;
}