* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.upload-section {
    margin: 20px 0;
    text-align: center;
}

.file-input {
    display: none;
}

.upload-label {
    display: block;
    padding: 40px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.upload-label:hover {
    border-color: #4CAF50;
    background-color: #f8f8f8;
}

.compress-options {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.option-group {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group input[type="range"] {
    flex: 1;
}

.option-group input[type="number"] {
    width: 100px;
    padding: 5px;
}

.preview-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.image-preview {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
}

.image-preview h3 {
    margin-bottom: 15px;
    color: #333;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.loading {
    text-align: center;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download-btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #45a049;
}

.batch-controls {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    transition: all 0.3s ease;
}

.action-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.total-progress {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
}

.images-list {
    max-width: 800px;
    margin: 20px auto;
}

.image-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 15px;
}

.image-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.image-preview-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.image-preview-box {
    flex: 1;
    min-width: 200px;
}

.image-preview-box img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.image-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.remove-image {
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.crop-container {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.crop-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.crop-content {
    padding: 20px;
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crop-area {
    flex: 1;
    min-height: 400px;
    background-color: #f8f8f8;
    position: relative;
}

.crop-area img {
    max-width: 100%;
    max-height: 100%;
}

.crop-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 10px;
}

.crop-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #f0f0f0;
    transition: all 0.3s ease;
}

.crop-btn:hover {
    background-color: #e0e0e0;
}

.crop-btn.confirm {
    background-color: #4CAF50;
    color: white;
}

.crop-btn.confirm:hover {
    background-color: #45a049;
}

.crop-btn.cancel {
    background-color: #ff4444;
    color: white;
}

.crop-btn.cancel:hover {
    background-color: #ff3333;
}

.image-controls .crop-single {
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    margin-right: 10px;
}

.image-controls .crop-single:hover {
    background-color: #1976D2;
}

.crop-dimensions {
    text-align: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

#cropDimensions {
    font-weight: bold;
    color: #4CAF50;
}

.custom-dimensions {
    margin: 15px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.dimension-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-group label {
    font-size: 14px;
    color: #666;
}

.input-group input {
    width: 100px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.dimension-separator {
    font-weight: bold;
    color: #666;
    margin: 0 5px;
}

#applyDimensions {
    display: block;
    margin: 10px auto 0;
    background-color: #2196F3;
}

#applyDimensions:hover {
    background-color: #1976D2;
}

.format-select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    margin-left: 10px;
}

.format-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.convert-format {
    background-color: #9C27B0;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    margin-left: 10px;
}

.convert-format:hover {
    background-color: #7B1FA2;
}

.convert-format:disabled {
    background-color: #E1BEE7;
    cursor: not-allowed;
}
  