/* =========================================
   SLICE CUTTER - KHATARNAK DARK THEME
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --primary: #8b5cf6; /* Violet */
    --accent: #ec4899;  /* Pink */
    --cyan: #06b6d4;
    
    --glass-bg: rgba(30, 41, 59, 0.4); 
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-white: #f8fafc;
    --text-gray: #94a3b8;
    
    --gradient-main: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Poppins', sans-serif;
    color: var(--text-white);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center; /* Horizontal Center */
    overflow-x: hidden;
    padding: 20px;
}

/* --- Background Animation (Blobs) --- */
.background-anim {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
}

.background-anim::before,
.background-anim::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite alternate ease-in-out;
}

.background-anim::before {
    background: var(--primary);
    top: -100px; left: -100px;
}

.background-anim::after {
    background: var(--cyan);
    bottom: -100px; right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* --- Container --- */
.app-container {
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

/* --- Header --- */
.tool-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.back-btn {
    text-decoration: none;
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateX(-3px);
}

.tool-header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Glass Card (Main Box) --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-gray);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label i {
    color: var(--accent);
}

/* --- Custom Dropdowns --- */
select {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-white);
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: 0.3s;
}

select:focus, select:hover {
    border-color: var(--primary);
    background-color: rgba(0, 0, 0, 0.5);
}

select option {
    background-color: var(--bg-dark);
    color: white;
}

/* --- Checkbox Row --- */
.checkbox-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-top: 10px;
}

.checkbox-label {
    margin: 0 !important;
    color: var(--text-white) !important;
}

input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* --- Upload Button --- */
.upload-section {
    margin-top: 30px;
}

.primary-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--text-gray);
    color: var(--text-white);
    padding: 18px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.primary-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

/* --- Results Area --- */
.results-area {
    margin-top: 40px;
    animation: fadeIn 0.6s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-white);
}

.grid-display {
    display: grid;
    gap: 4px; /* Space between slices */
    background: transparent;
    border: 2px dashed var(--glass-border);
    padding: 10px;
    border-radius: 16px;
    overflow: hidden;
}

.grid-display img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.grid-display img:hover {
    transform: scale(1.05);
    z-index: 10;
    position: relative;
}

/* --- Download Button (Khatarnak Style) --- */
.download-btn {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4);
    transition: all 0.3s;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.6);
}

.download-btn:active {
    transform: scale(0.96);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Fixes */
@media (max-width: 500px) {
    .glass-card { padding: 20px; }
    .tool-header h1 { font-size: 1.2rem; }
    .results-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .download-btn { width: 100%; justify-content: center; }
}
