/* General Styles & Icons */
:root {
    --primary-color: #007bff; --primary-hover: #0056b3; --secondary-color: #f0f2f5;
    --text-color: #333; --border-color: #ddd;
}
.pro-image-resizer {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color); max-width: 1200px; margin: auto;
    background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); overflow: hidden;
}
[class^="icon-"]::before {
    display: inline-block; margin-right: 8px; font-family: "Font Awesome 5 Free"; font-weight: 900;
}
.icon-upload::before { content: "\f093"; } .icon-device::before { content: "\f108"; }
.icon-url::before { content: "\f0c1"; } .icon-resize::before { content: "\f0b2"; } .icon-download::before { content: "\f019"; }

/* Header and Panel */
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-header h3 { margin: 0; }
.settings-panel h4 { font-size: 1.1rem; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-top: 25px; margin-bottom: 15px; }

/* Upload Section */
#upload-section { padding: 40px; text-align: center; }
#upload-section h2 { font-size: 2.5rem; margin-bottom: 10px; }
#drop-zone {
    border: 3px dashed var(--border-color); border-radius: 10px; padding: 40px;
    transition: background-color 0.3s, border-color 0.3s;
}
#drop-zone.dragover { background-color: #e9f5ff; border-color: var(--primary-color); }
#drop-zone .icon-upload { font-size: 4rem; color: var(--primary-color); }
.upload-options { margin-top: 15px; display: flex; justify-content: center; gap: 10px; }

/* Buttons & Inputs */
.btn-primary, .btn-secondary {
    padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer; font-size: 1rem;
    font-weight: bold; text-decoration: none; display: inline-flex; align-items: center;
    justify-content: center; transition: background-color 0.3s, box-shadow 0.3s;
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.btn-secondary { background-color: var(--secondary-color); color: var(--text-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { background-color: #e2e6ea; }
.btn-large { padding: 15px 30px; font-size: 1.2rem; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; width: 100%; margin-top: 10px; }
.btn-reset {
    background: none; border: none; color: var(--primary-color); text-decoration: underline;
    cursor: pointer; font-size: 0.9rem; padding: 5px;
}

/* UPDATED START: Rotation Slider Style */
.rotation-control {
    display: flex;
    align-items: center;
    gap: 15px;
}
#rotate-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e9ecef;
    outline: none;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity .2s;
}
#rotate-slider:hover { opacity: 1; }
#rotate-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
}
#rotate-slider::-moz-range-thumb {
    width: 20px; height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}
#rotate-value {
    font-weight: bold;
    font-family: monospace;
    font-size: 1.1rem;
    min-width: 45px;
    text-align: right;
}
/* UPDATED END */

/* Editor Section */
.resizer-main-content { display: flex; gap: 20px; padding: 20px; }
.settings-panel { flex: 1; min-width: 300px; }
.image-preview-panel { flex: 2; display: flex; align-items: center; justify-content: center; background: #f0f2f5; border-radius: 8px; min-height: 400px; }
#main-image-preview-wrapper { max-width: 100%; height: 450px; }
#image-preview { display: block; max-width: 100%; }

/* Settings Inputs */
.setting-group { margin-bottom: 20px; }
.setting-group label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 0.9rem; }
.setting-group input[type="number"], .setting-group select {
    width: 100%; padding: 10px; border: 1px solid var(--border-color);
    border-radius: 6px; font-size: 1rem; box-sizing: border-box;
}
.size-inputs { display: flex; gap: 10px; }
.size-inputs input { flex-grow: 1; } .size-inputs select { max-width: 80px; }
.aspect-ratio-lock { display: flex; align-items: center; gap: 8px; }
.aspect-ratio-lock input[type="checkbox"] { width: auto; }

/* Color Picker Style */
.color-picker-wrapper { display: flex; align-items: center; gap: 10px; }
#bg-color-input { width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; }
#bg-color-text { font-family: monospace; background: #f0f2f5; padding: 5px 8px; border-radius: 4px; }

/* Download Modal */
#download-section-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7);
    display: none; align-items: center; justify-content: center; z-index: 10000;
}
.download-modal { background: white; padding: 40px; border-radius: 12px; text-align: center; max-width: 500px; width: 90%; position: relative; }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; color: #aaa; }
#download-details { margin-top: 20px; text-align: left; background: #f9f9f9; padding: 15px; border-radius: 8px; }
#download-details p { margin: 8px 0; }

/* Responsive Design */
@media (max-width: 768px) {
    #upload-section h2 { font-size: 2rem; }
    .resizer-main-content { flex-direction: column; }
    .image-preview-panel { order: -1; min-height: 300px; }
    #main-image-preview-wrapper { height: 300px; }
    .download-modal { padding: 25px; }
}