/* Quick Access Workbench ? Shared Styles */
:root {
    --primary: #84cc16;
    --primary-glow: rgba(132, 204, 22, 0.3);
    --dark-bg: #0a0f0a;
    --card-bg: rgba(20, 26, 20, 0.8);
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background:
        radial-gradient(circle at top, rgba(132, 204, 22, 0.08) 0%, rgba(132, 204, 22, 0.03) 24%, transparent 48%),
        linear-gradient(180deg, #09110a 0%, #0c140d 52%, #0a100b 100%);
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px;
    background: rgba(10, 15, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(132, 204, 22, 0.2);
}

.logo-container {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 20px;
    text-decoration: none; color: white;
}

.logo-mark {
    width: 42px; height: 42px; border-radius: 14px;
    object-fit: cover; flex-shrink: 0;
    box-shadow: 0 0 24px rgba(132, 204, 22, 0.28);
}

.brand-wordmark { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.brand-wordmark .accent { color: var(--primary); }
.back-btn { font-size: 14px; color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
.back-btn:hover { color: var(--primary); }

.workspace { display: grid; grid-template-columns: 1fr 420px; flex: 1; overflow: hidden; }

.canvas-area {
    background: radial-gradient(ellipse at center, rgba(132, 204, 22, 0.03) 0%, transparent 70%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 30px; position: relative; gap: 20px;
}

.canvas-area::before {
    content: ''; position: absolute; top: 20px; left: 20px;
    width: 60px; height: 60px;
    border-left: 2px solid var(--primary); border-top: 2px solid var(--primary); opacity: 0.3;
}

.canvas-area::after {
    content: ''; position: absolute; bottom: 20px; right: 20px;
    width: 60px; height: 60px;
    border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); opacity: 0.3;
}

.upload-zone {
    width: 100%; max-width: 800px; height: 60vh;
    border: 2px dashed rgba(132, 204, 22, 0.5); border-radius: 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer; transition: all 0.3s ease;
    background: rgba(132, 204, 22, 0.05);
    box-shadow: 0 0 30px rgba(132, 204, 22, 0.2), 0 0 60px rgba(132, 204, 22, 0.1), inset 0 0 40px rgba(132, 204, 22, 0.05);
}

.upload-zone:hover {
    border-color: var(--primary); background: rgba(132, 204, 22, 0.12);
    box-shadow: 0 0 50px rgba(132, 204, 22, 0.4), 0 0 100px rgba(132, 204, 22, 0.2), inset 0 0 60px rgba(132, 204, 22, 0.1);
}

.upload-icon { font-size: 60px; margin-bottom: 16px; filter: drop-shadow(0 0 20px rgba(132, 204, 22, 0.4)); }
.upload-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.upload-hint { font-size: 0.95rem; color: var(--text-muted); }

.image-container {
    position: relative; width: min(100%, 1100px); border-radius: 12px; overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5); border: 1px solid rgba(132, 204, 22, 0.2);
    background: #000; display: none; flex: 0 0 auto;
}

#mainImage, #resultImage {
    position: absolute; inset: 0; width: 100%; height: 100%;
    display: block; object-fit: contain; object-position: center; background: #000;
}
#mainImage { z-index: 1; }
#resultImage { z-index: 2; display: none; clip-path: inset(0 50% 0 0); }

.slider-line {
    position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
    background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
    z-index: 10; pointer-events: none; display: none;
}
.slider-handle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 36px; height: 36px; background: white; border-radius: 50%; cursor: ew-resize;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); z-index: 20; font-size: 18px; color: #333;
}
.download-btn {
    position: absolute; bottom: 20px; right: 20px;
    background: linear-gradient(135deg, #84cc16, #22c55e);
    color: #000; border: none; padding: 10px 20px; border-radius: 20px;
    font-weight: bold; font-family: 'Outfit', sans-serif; cursor: pointer;
    display: none; box-shadow: 0 4px 12px var(--primary-glow); z-index: 100; transition: transform 0.2s;
}
.download-btn:hover { transform: scale(1.05); }

/* Loading shimmer */
.canvas-area.generating .image-container::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(132, 204, 22, 0.08), rgba(255, 255, 255, 0.12), rgba(132, 204, 22, 0.08), transparent);
    animation: shimmerSweep 2s ease-in-out infinite; z-index: 50; pointer-events: none;
}
@keyframes shimmerSweep { 0% { left: -60%; } 100% { left: 120%; } }
.canvas-area.generating .image-container { box-shadow: 0 0 40px rgba(132, 204, 22, 0.15), 0 0 80px rgba(132, 204, 22, 0.05); }

.countdown-pill {
    display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(10, 15, 10, 0.85); backdrop-filter: blur(16px);
    border: 1px solid rgba(132, 204, 22, 0.3); border-radius: 60px;
    padding: 14px 32px; z-index: 200; align-items: center; gap: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.countdown-pill.active { display: flex; }
.countdown-pill .pill-ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.countdown-pill .pill-ring svg { transform: rotate(-90deg); }
.countdown-pill .pill-ring .bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 4; }
.countdown-pill .pill-ring .progress { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 188; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.countdown-pill .pill-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; font-weight: 700; color: #fff; }
.countdown-pill .pill-text { color: #ccc; font-size: 13px; white-space: nowrap; }

.history-bar {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 90px;
    background: rgba(10, 15, 10, 0.9); display: none; padding: 10px; gap: 12px;
    overflow-x: auto; z-index: 90; border-top: 1px solid rgba(132, 204, 22, 0.15); align-items: center;
}
.history-item {
    height: 70px; width: 70px; border-radius: 8px; cursor: pointer;
    border: 2px solid rgba(132, 204, 22, 0.2); object-fit: cover; transition: all 0.2s; flex-shrink: 0;
}
.history-item:hover { border-color: var(--primary); transform: scale(1.1); }

/* Sidebar */
.sidebar {
    overflow-y: auto; min-height: 0;
    background: linear-gradient(180deg, rgba(20, 26, 20, 0.95) 0%, rgba(15, 20, 15, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(132, 204, 22, 0.15);
    display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
}
.panel-scroll { flex: 1; overflow-y: auto; padding: 30px; min-height: 0; }
.tool-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid rgba(132, 204, 22, 0.2); }
.tool-badge { display: inline-block; padding: 6px 14px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; background: rgba(132, 204, 22, 0.15); color: var(--primary); border-radius: 12px; margin-bottom: 12px; }
.tool-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.tool-desc { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.panel-label { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; }

.style-selector-container {
    max-height: 340px; overflow-y: auto; padding: 12px; margin-bottom: 24px;
    border: 1px solid rgba(132, 204, 22, 0.15); border-radius: 12px; background: rgba(132, 204, 22, 0.03);
}
.style-selector-container::-webkit-scrollbar { width: 4px; }
.style-selector-container::-webkit-scrollbar-track { background: transparent; }
.style-selector-container::-webkit-scrollbar-thumb { background: rgba(132, 204, 22, 0.3); border-radius: 4px; }

.style-grid-compact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.style-card-compact {
    aspect-ratio: 1; background: rgba(20, 26, 20, 0.8); border-radius: 10px;
    position: relative; cursor: pointer; border: 2px solid transparent;
    overflow: hidden; transition: transform 0.1s;
}
.style-card-compact:hover { transform: scale(1.02); z-index: 2; }
.style-card-compact img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.style-card-compact:hover img { opacity: 0.9; }
.style-card-compact.selected { border-color: var(--primary); }
.style-card-compact.selected img { opacity: 1; }
.style-name-compact { position: absolute; bottom: 0; width: 100%; background: rgba(0,0,0,0.7); color: #fff; font-size: 10px; text-align: center; padding: 4px 0; font-weight: 500; }

input[type="range"] { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; outline: none; -webkit-appearance: none; margin-bottom: 24px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: linear-gradient(145deg, #84cc16, #22c55e); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px var(--primary-glow); }

input[type="text"], textarea {
    width: 100%; padding: 14px; background: rgba(132, 204, 22, 0.05);
    border: 1px solid rgba(132, 204, 22, 0.15); color: white; border-radius: 12px;
    font-family: 'Outfit', sans-serif; font-size: 0.9rem; transition: all 0.3s; resize: none;
}
input[type="text"]:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 20px rgba(132, 204, 22, 0.15); }
input[type="text"]::placeholder, textarea::placeholder { color: rgba(255,255,255,0.3); }

.panel-footer { padding: 24px 30px; border-top: 1px solid rgba(132, 204, 22, 0.15); background: rgba(10, 15, 10, 0.5); }
.btn-primary {
    width: 100%; padding: 18px; background: linear-gradient(135deg, #84cc16, #22c55e);
    color: #000; border: none; border-radius: 14px; font-weight: 700; cursor: pointer;
    display: flex; justify-content: center; gap: 8px; font-size: 15px;
    font-family: 'Outfit', sans-serif; box-shadow: 0 4px 24px var(--primary-glow); transition: all 0.3s;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(132, 204, 22, 0.45); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 900px) {
    body { height: auto; min-height: 100vh; overflow-y: auto; }
    .workspace { overflow: visible; min-height: auto; grid-template-columns: 1fr; }
    header { padding: 12px 16px; }
    .logo-container { font-size: 18px; gap: 8px; }
    .back-btn { font-size: 13px; }
    .canvas-area { padding: 12px; }
    .canvas-area::before, .canvas-area::after { display: none; }
    .upload-zone { height: 40vh; max-width: 100%; border-radius: 14px; }
    .sidebar { overflow-y: auto; min-height: 0; border-left: none; border-top: 1px solid rgba(132, 204, 22, 0.15); }
    .tool-header { margin-bottom: 16px; padding-bottom: 12px; }
    .tool-title { font-size: 18px; }
    .tool-desc { font-size: 13px; }
    .btn-primary { padding: 14px; font-size: 14px; }
    .image-container { max-width: 100%; }
    .panel-scroll { padding: 16px; }
    .style-selector-container { max-height: 200px; padding: 8px; margin-bottom: 16px; }
    .style-grid-compact { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .panel-footer { padding: 16px; }
    .history-bar { height: 70px; padding: 6px; gap: 8px; }
    .history-item { height: 55px; width: 55px; }
    .countdown-pill { padding: 10px 20px; }
}

