* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            max-width: 100%;
        }

        html, body {
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
            overflow-y: auto;
        }

        :root {
            --primary-color: #3498db;
            --secondary-color: #2ecc71;
            --background-color: #ecf0f1;
            --text-color: #34495e;
            --border-radius: 8px;
        }

        body {
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            min-height: 100vh;
            background-color: var(--background-color);
            color: var(--text-color);
            overflow-x: hidden;
            width: 100%;
            max-width: 100%;
        }

        .container {
            max-width: 1200px;
            width: 95%;
            padding: 40px;
            box-sizing: border-box;
            overflow-y: auto;
            max-height: 95vh;
            background-color: white;
            border-radius: 20px;
            box-shadow: 0 15px 30px rgba(0,0,0,0.1);
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            margin: 20px 0;
        }

        h1 {
            color: var(--primary-color);
            text-align: center;
            margin-bottom: 30px;
            font-weight: 700;
        }

        .input-group {
            margin-bottom: 10px;
            position: relative;
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
        }

        input[type="number"] {
            width: 100%;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: var(--border-radius);
            font-size: 16px;
            transition: border-color 0.3s ease;
            padding-left: 40px;
        }

        input[type="number"]:focus {
            border-color: var(--primary-color);
            outline: none;
        }

        .input-group i {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            color: var(--primary-color);
        }

        .file-input-wrapper {
            position: relative;
            overflow: hidden;
            display: inline-block;
            width: 100%;
            border: 2px dashed var(--primary-color);
            padding: 20px;
            text-align: center;
            transition: all 0.3s ease;
        }

        .file-input-wrapper.dragover {
            background-color: rgba(52, 152, 219, 0.1);
            border-color: var(--secondary-color);
        }

        .file-input-wrapper input[type="file"] {
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
            cursor: pointer;
            width: 100%;
            height: 100%;
        }

        .file-input-wrapper .btn {
            display: inline-block;
            padding: 12px 20px;
            background-color: var(--secondary-color);
            color: white;
            border-radius: var(--border-radius);
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .file-input-wrapper .btn:hover {
            background-color: #27ae60;
        }

        .btn {
            background-image: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            padding: 12px 24px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            margin: 4px 2px;
            cursor: pointer;
            border-radius: var(--border-radius);
            transition: all 0.3s ease;
        }

        .btn:hover {
            background-image: linear-gradient(to right, var(--secondary-color), var(--primary-color));
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        .btn:active {
            transform: translateY(0);
        }

        .image-container {
            display: flex;
            flex-direction: row;
            gap: 15px;
            margin-top: 30px;
            align-items: center;
            justify-content: center;
        }

        .image-box {
            flex: 1;
            margin: 0;
            text-align: center;
            background-color: #f9f9f9;
            border-radius: var(--border-radius);
            padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
        }

        .image-box:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        }

        .image-box h3 {
            margin-top: 0;
            color: var(--primary-color);
        }

        .image-box img {
            max-width: 100%;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        img {
            max-width: 100%;
            height: auto;
            display: block;
        }

        #originalImagesContainer,
        #resizedImagesContainer {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 15px;
            justify-content: center;
            align-items: center;
        }

        .uploaded-image,
        .resized-image {
            max-width: 100%;
            height: auto;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            max-height: 300px;
            object-fit: contain;
        }

        #originalImage, #resizedImage {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 0 auto;
        }

        #cropModal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.8);
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background-color: #fefefe;
            margin: 5% auto;
            padding: 30px;
            border: 1px solid #888;
            width: 80%;
            max-width: 700px;
            border-radius: var(--border-radius);
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .close:hover,
        .close:focus {
            color: #000;
        }

        .icon {
            margin-right: 8px;
        }

        .dimensions-container {
            display: flex;
            gap: 20px;
        }

        .dimensions-container .input-group {
            flex: 1;
        }

        .action-buttons {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 20px;
        }

        .toggle-container {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 34px;
            margin-right: 10px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 34px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked + .slider {
            background-color: var(--primary-color);
        }

        input:checked + .slider:before {
            transform: translateX(26px);
        }

        .percentage-slider {
            width: 100%;
            margin-top: 10px;
        }

        .loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid var(--primary-color);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @media (min-width: 768px) {
            .image-container {
                flex-direction: row;
            }
        }

        @media (max-width: 600px) {
            .container {
                padding: 20px;
            }

            .dimensions-container {
                flex-direction: column;
            }

            .action-buttons {
                flex-direction: column;
            }

            .btn {
                width: 100%;
            }
        }

        #saveButton {
            margin: 20px auto;
            display: block;
            width: auto;
        }
