/* Base Styles */
.image-resizer-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.resizer-header {
    text-align: center;
    margin-bottom: 25px;
}

.resizer-header h2 {
    color: #2c3e50;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.resizer-header p {
    color: #7f8c8d;
    margin: 0;
}

/* Drop Zone Styles */
.drop-zone {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: #3498db;
    background-color: #f8fafc;
}

.drop-zone i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 15px;
}

.drop-zone p {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 10px;
}

.drop-zone span {
    display: block;
    color: #7f8c8d;
    margin: 10px 0;
}

.upload-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-btn:hover {
    background: #2980b9;
}

/* Resizer Controls */
.resizer-controls {
    display: flex;
    flex-direction: column;
}

.preview-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-preview {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.original-size {
    margin-top: 10px;
    font-size: 14px;
    color: #7f8c8d;
    text-align: center;
}

.size-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
}

.dimension-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 120px;
}

.aspect-ratio-display {
    min-width: 80px;
}

.aspect-ratio-value {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-group label {
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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: 24px;
}

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

input:checked + .slider {
    background-color: #3498db;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.control-group label {
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.control-group input[type="number"] {
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 14px;
}

.control-group select {
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

.format-group {
    flex: 2;
}

.quality-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 2;
    min-width: 200px;
}

.quality-control label {
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.quality-control input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.btn-resize, .btn-download, .btn-change, .btn-reset {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 100px;
}

.btn-resize {
    background: #2ecc71;
    color: white;
}

.btn-resize:hover {
    background: #27ae60;
}

.btn-download {
    background: #3498db;
    color: white;
}

.btn-download:hover {
    background: #2980b9;
}

.btn-download:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-change {
    background: #f39c12;
    color: white;
}

.btn-change:hover {
    background: #e67e22;
}

.btn-reset {
    background: #e74c3c;
    color: white;
}

.btn-reset:hover {
    background: #c0392b;
}

.resizer-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .image-resizer-container {
        padding: 15px;
    }
    
    .resizer-header h2 {
        font-size: 20px;
    }
    
    .drop-zone {
        padding: 30px 15px;
    }
    
    .dimension-controls, .settings-row {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-resize, .btn-download, .btn-change, .btn-reset {
        width: 100%;
    }
}