:root {
    --bg: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-muted: #eeeeee;
    --text: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #999999;
    --accent: #e53935;
    --accent-hover: #c62828;
    --accent-light: rgba(229, 57, 53, 0.08);
    --border: #e0e0e0;
    --border-hover: #bdbdbd;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --navbar-h: 56px;
    --success: #16a34a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    height: 100dvh;
    font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-subtle);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Orijinal Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: box-shadow 0.2s ease;
}

.navbar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
}

.navbar-brand {
    font-weight: 800;
    color: var(--accent);
}

.navbar-status {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-muted);
    transition: all 0.2s ease;
}

.navbar-status.active {
    background: var(--accent-light);
    color: var(--accent);
}

.navbar-status.ready {
    background: rgba(22, 163, 74, 0.08);
    color: var(--success);
}

/* App Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    height: calc(100% - var(--navbar-h));
    height: calc(100dvh - var(--navbar-h));
    margin-top: var(--navbar-h);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    background: var(--bg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* Stage (Main Workspace) */
.stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
}

.stage.drag-over {
    background: var(--accent-light);
    outline: 2px dashed var(--accent);
    outline-offset: -8px;
}

/* Empty State */
.stage-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 440px;
    gap: 12px;
    color: var(--text-secondary);
}

.empty-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stage-empty h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.stage-empty p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Loading State */
.stage-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-muted);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result State */
.stage-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 16px;
    min-height: 0;
}

.result-image-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: var(--bg-muted);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.action-btn.primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Input Container */
.input-container {
    padding: 12px 20px 16px;
    flex-shrink: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.thumbs-row {
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.thumbs-row::-webkit-scrollbar {
    display: none;
}

.thumb-card {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-remove:hover {
    background: var(--accent);
}

.input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 6px 6px 6px 14px;
    transition: all 0.15s ease;
}

.input-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.prompt-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    resize: none;
    line-height: 1.4;
    max-height: 140px;
    padding: 8px 0;
}

.prompt-input::placeholder {
    color: var(--text-muted);
}

.icon-btn, .send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.icon-btn {
    background: transparent;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.send-btn {
    background: var(--accent);
    color: #ffffff;
}

.send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.hidden-file-input, .hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1a1a1a;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-layout {
        border: none;
    }
    .stage {
        padding: 12px 16px;
    }
    .input-container {
        padding: 10px 16px 14px;
    }
    .action-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}
