/* --- Keep your existing :root and body styles --- */
:root {
    --primary-blue: #007bff;
    --primary-purple: #6f42c1;
    --success-green: #28a745;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --container-bg: #ffffff;
    --text-dark: #343a40;
    --text-light: #6c757d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    background: var(--bg-gradient);
    padding: 20px 10px;
    color: var(--text-dark);
    min-height: 100vh;
    box-sizing: border-box;
    margin: 0;
}

/* --- App Container & Buttons (Keep existing) --- */
.app-container {
    background: var(--container-bg);
    padding: 25px 15px;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 95%;
    max-width: 450px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

h2 { color: var(--primary-purple); margin-bottom: 20px; font-size: 1.5rem; }

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 8px rgba(0,0,0,0.15); }
.btn-blue { background-color: var(--primary-blue); }
.btn-purple { background-color: var(--primary-purple); }
.btn-green { background-color: var(--success-green); }

input[type="file"] { display: none; }
.custom-file-upload { display: inline-block; cursor: pointer; }

/* --- Workspace & Crop Box --- */
.workspace-container {
    margin: 20px auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    width: 100%;
    max-width: 400px; 
    box-sizing: border-box;
}

.workspace {
    position: relative;
    display: inline-block;
    border: 2px solid #e9ecef;
    overflow: hidden;
    background-color: #fff;
    max-width: 100%; 
    vertical-align: top;
}

#sourceImage {
    display: block;
    width: 100%;
    height: auto; 
    opacity: 0; 
    transition: opacity 0.3s ease;
}
#sourceImage.loaded { opacity: 1; }

#cropBox {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    /* Default is circle */
    border-radius: 50%; 
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    cursor: move;
    touch-action: none; 
    box-sizing: border-box;
}

/* NEW: Class for Rectangle Shape */
#cropBox.rect-shape {
    border-radius: 0; /* Makes it square/rectangular */
}

/* --- Controls --- */
.control-group { margin: 20px 0; width: 100%; }
.hidden { display: none !important; }

/* Radio Button Styles */
.radio-label {
    margin: 0 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-dark);
}

.slider-group { margin-bottom: 10px; }
.slider-label { color: var(--primary-blue); font-weight: bold; display: inline-block; margin-bottom: 5px; }
input[type=range] { max-width: 60%; vertical-align: middle; }
span[id$="Value"] { display: inline-block; width: 50px; font-weight: bold; color: var(--text-dark); background: #e9ecef; padding: 2px 5px; border-radius: 5px; font-size: 14px; }

/* --- Results & Footer --- */
.result-heading { color: var(--primary-purple); margin-top: 30px; }

#croppedResult {
    margin-top: 10px;
    border: 3px solid #e9ecef;
    border-radius: 10px;
    max-width: 200px;
    width: auto;
    height: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    opacity: 0; 
}
#croppedResult.has-result { opacity: 1; }
#downloadArea { margin-top: 20px; }

.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    font-size: 13px;
    color: var(--text-light);
}
.developer { color: var(--primary-purple); margin-top: 10px !important; }