/* Retro Neo-Brutalist (Saweria / AutoGopek Style) Stylesheet */
:root {
    --bg-main: #eef2f7;
    --bg-card: #ffffff;
    --text-color: #000000;
    --text-muted: #555555;
    
    /* Neo-Brutalist Color Palette */
    --color-yellow: #fde047; /* Yellow card */
    --color-green: #bbf7d0;  /* Green card */
    --color-blue: #bfdbfe;   /* Blue card */
    --color-purple: #c7d2fe; /* Purple card */
    --color-cyan: #a5f3fc;   /* Sidebar hover */
    --color-orange: #fdba74; /* Orange accent */
    --color-red: #fca5a5;    /* Red status/error */
    
    --border-width: 3px;
    --border-style: solid #000000;
    --shadow-main: 5px 5px 0px #000000;
    --shadow-button: 3px 3px 0px #000000;
    
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-color);
    font-family: var(--font-family);
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Banner Top Header - Marquee Running Text */
.top-banner {
    background-color: #fcd34d;
    border-bottom: var(--border-width) var(--border-style);
    padding: 0.45rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    overflow: hidden;
    white-space: nowrap;
    display: block;
}

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    display: block;
}

.marquee-track {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
    animation: marquee-scroll 50s linear infinite;
}

.marquee-track span {
    display: inline;
    white-space: nowrap;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.sub-banner {
    background-color: #bbf7d0;
    border-bottom: var(--border-width) var(--border-style);
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

/* App Header Container */
.header-bar {
    max-width: 1400px;
    margin: 1.5rem auto 0.5rem auto;
    background-color: var(--bg-card);
    border: var(--border-width) var(--border-style);
    border-radius: 12px;
    box-shadow: var(--shadow-main);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-logo {
    background-color: var(--color-yellow);
    border: 2px solid #000;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 2px 2px 0px #000;
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #fff;
    border: 2px solid #000;
    box-shadow: 2px 2px 0px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.15s ease;
}

.logout-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px #000;
}

.logout-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000;
}

/* Layout Grid */
.main-wrapper {
    max-width: 1400px;
    margin: 1.5rem auto;
    width: 95%;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.8rem;
}

@media (max-width: 1100px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Navigasi */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-item {
    background-color: #ffffff;
    border: var(--border-width) var(--border-style);
    border-radius: 10px;
    box-shadow: var(--shadow-button);
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px #000;
    background-color: var(--color-cyan);
}

.nav-item.active {
    background-color: var(--color-blue);
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000;
}

/* Main Dashboard Area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
}

.stat-card-retro {
    background-color: var(--bg-card);
    border: var(--border-width) var(--border-style);
    border-radius: 12px;
    box-shadow: var(--shadow-main);
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.stat-card-retro.yellow { background-color: var(--color-yellow); }
.stat-card-retro.green { background-color: var(--color-green); }
.stat-card-retro.blue { background-color: var(--color-blue); }
.stat-card-retro.purple { background-color: var(--color-purple); }

.stat-card-content h4 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.stat-card-content p {
    font-size: 1.5rem;
    font-weight: 800;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid #000;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 2px 2px 0px #000;
}

.stat-card-footer {
    position: absolute;
    bottom: 0.8rem;
    left: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #000;
    background: #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

/* Two Column Work Dashboard */
.dashboard-split {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}

/* Bot panel - fixed height same as terminal */
.dashboard-bot-panel {
    display: flex;
    flex-direction: column;
    height: 560px;
    overflow: hidden;
}

.retro-panel {
    background-color: var(--bg-card);
    border: var(--border-width) var(--border-style);
    border-radius: 12px;
    box-shadow: var(--shadow-main);
    padding: 1.5rem;
}

.retro-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--border-width) var(--border-style);
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
}

.retro-panel-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bot List Table / Grid - Scrollable */
.bot-table-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
    /* scroll aktif setelah sekitar 3 bot */
    max-height: calc(560px - 100px);
    padding-right: 4px;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #000 #eee;
}

.bot-table-container::-webkit-scrollbar {
    width: 6px;
}

.bot-table-container::-webkit-scrollbar-track {
    background: #eee;
    border-radius: 4px;
    border: 1px solid #000;
}

.bot-table-container::-webkit-scrollbar-thumb {
    background-color: #000;
    border-radius: 4px;
}

.bot-row-retro {
    border: 2px solid #000000;
    border-radius: 10px;
    padding: 1.2rem;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: all 0.15s ease;
}

.bot-row-retro:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px #000;
}

.bot-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.bot-row-divider {
    border-top: 2px solid #000000;
    margin: 0.2rem 0;
    width: 100%;
}

.bot-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    width: 100%;
}

.bot-row-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.bot-row-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #000;
    background-color: var(--color-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 2px 2px 0px #000;
}

.bot-row-detail h3 {
    font-size: 1.05rem;
    font-weight: 800;
}

.bot-row-detail span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bot-row-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bot-stat-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #000;
    background-color: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.bot-stat-pill.online { background-color: var(--color-green); }
.bot-stat-pill.offline { background-color: var(--color-red); }
.bot-stat-pill.installing { background-color: var(--color-blue); }

.bot-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* Neo-Brutalist Buttons */
.btn-retro {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    border: 2px solid #000;
    border-radius: 6px;
    background-color: #ffffff;
    cursor: pointer;
    box-shadow: var(--shadow-button);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.1s ease;
}

.btn-retro:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px #000;
}

.btn-retro:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000;
}

.btn-retro.yellow { background-color: var(--color-yellow); }
.btn-retro.green { background-color: var(--color-green); }
.btn-retro.blue { background-color: var(--color-blue); }
.btn-retro.red { background-color: var(--color-red); }
.btn-retro.cyan { background-color: var(--color-cyan); }

.btn-retro:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 1px 1px 0px #000 !important;
}

/* Log Panel / Terminal style - fixed height same as bot panel */
.terminal-card-retro {
    background-color: #000000;
    color: #ffffff;
    border: var(--border-width) var(--border-style);
    border-radius: 12px;
    box-shadow: var(--shadow-main);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    height: 560px;
}

.terminal-header-retro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid #333333;
    padding-bottom: 0.6rem;
    margin-bottom: 0.8rem;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-red);
}
.terminal-dot.active {
    background-color: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    color: #dddddd;
    padding-right: 0.5rem;
}

/* Drag Drop Zone */
.drag-drop-retro {
    border: 3px dashed #000;
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    background-color: #fff;
    box-shadow: var(--shadow-main);
    transition: all 0.15s ease;
}

.drag-drop-retro * {
    pointer-events: none;
}

.drag-drop-retro:hover {
    background-color: rgba(165, 243, 252, 0.2);
}

.drag-drop-retro.dragover {
    background-color: var(--color-cyan) !important;
    border-style: solid !important;
    box-shadow: 7px 7px 0px #000 !important;
    transform: scale(1.02);
}

.drag-drop-retro i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.drag-drop-retro p {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.drag-drop-retro span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-container-retro {
    margin-top: 1.5rem;
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-button);
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.progress-bar-retro-outer {
    height: 16px;
    background-color: #eee;
    border: 2px solid #000;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-retro-inner {
    height: 100%;
    background-color: var(--color-yellow);
    transition: width 0.3s ease;
}

/* Login Overlay */
.login-overlay-retro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(238, 242, 247, 0.98);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-retro {
    background-color: #ffffff;
    border: var(--border-width) var(--border-style);
    border-radius: 16px;
    box-shadow: var(--shadow-main);
    padding: 3rem 2rem;
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.login-card-retro .logo-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px solid #000;
    background-color: var(--color-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.5rem auto;
    box-shadow: 3px 3px 0px #000;
}

.login-card-retro h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-card-retro p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-box-retro {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-box-retro i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
}

.input-box-retro input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border: var(--border-width) var(--border-style);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-button);
    outline: none;
}

.input-box-retro input:focus {
    background-color: rgba(165, 243, 252, 0.1);
}

.btn-retro-block {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
}

.error-retro {
    background-color: var(--color-red);
    border: 2px solid #000;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 1.2rem;
    box-shadow: 2px 2px 0px #000;
}

/* Helper styles */
.hidden {
    display: none !important;
}

.no-bots-retro {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    border: 2px dashed #000;
    border-radius: 10px;
    background-color: #fafafa;
}

.no-bots-retro i {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.no-bots-retro p {
    font-weight: 700;
}

/* Toast Notifications */
.toast-retro {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #fff;
    border: 3px solid #000;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow-main);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toast-retro.success { background-color: var(--color-green); }
.toast-retro.error { background-color: var(--color-red); }

/* Custom Confirm Modal */
.modal-overlay-retro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-card-retro {
    background-color: #ffffff;
    border: var(--border-width) var(--border-style);
    border-radius: 16px;
    box-shadow: var(--shadow-main);
    padding: 2rem;
    width: 90%;
    max-width: 440px;
    text-align: center;
    animation: modal-pop 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-pop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-logo-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid #000;
    background-color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.2rem auto;
    box-shadow: 2px 2px 0px #000;
}

.modal-card-retro h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-card-retro p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
    line-height: 1.5;
}

.modal-actions-retro {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.modal-actions-retro .btn-retro {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

/* Background Remover Panel Specific Styles */
.bg-queue-row {
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
}

.bg-queue-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-button);
}

.bg-row-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    min-width: 0;
}

.bg-row-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.bg-thumb-container {
    width: 44px;
    height: 44px;
    border: 2px solid #000;
    border-radius: 6px;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.bg-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-file-icon {
    font-size: 1.2rem;
    color: #888;
}

.bg-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bg-file-name {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bg-row-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bg-item-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #000;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.bg-item-status.pending { background-color: var(--color-orange); }
.bg-item-status.processing { background-color: var(--color-blue); }
.bg-item-status.completed { background-color: var(--color-green); }
.bg-item-status.failed { background-color: var(--color-red); }

.bg-row-action-box {
    display: flex;
    gap: 0.4rem;
}

/* Interactive Background Preview Modal Styles */
.modal-backdrop-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: modal-fadein 0.15s ease-out;
}

@keyframes modal-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content-bg {
    background-color: #ffffff;
    border: 3px solid #000000;
    border-radius: 12px;
    box-shadow: 6px 6px 0px #000000;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modal-pop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.preview-bg-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.preview-bg-controls .btn-retro {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.preview-bg-controls .btn-retro.active {
    background-color: var(--color-yellow);
    box-shadow: none;
    transform: translateY(2px);
}

.preview-viewport {
    border: 3px solid #000000;
    border-radius: 8px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
    background-color: #f3f4f6;
    transition: background-color 0.2s ease;
}

.preview-viewport img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Checkerboard background */
.checkerboard {
    background-color: #ffffff;
    background-image: linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
                      linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
                      linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

[data-theme="dark"] .modal-content-bg {
    background-color: #1f2937;
    border-color: #ffffff;
    box-shadow: 6px 6px 0px #ffffff;
}

[data-theme="dark"] .checkerboard {
    background-color: #374151;
    background-image: linear-gradient(45deg, #1f2937 25%, transparent 25%),
                      linear-gradient(-45deg, #1f2937 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #1f2937 75%),
                      linear-gradient(-45deg, transparent 75%, #1f2937 75%);
}
