:root {
    --primary: #1a73e8;
    --hover-bg: #e8f0fe;
    --text-main: #3c4043;
    --text-sub: #5f6368;
    --border: #dadce0;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background: #f8f9fa;
}

/* TOPBAR */
.topbar {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.top-center input {
    width: 400px;
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    background: #f1f3f4;
}

/* LAYOUT */
.container {
    display: flex;
    height: calc(100vh - 60px);
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: white;
    padding: 20px;
    overflow-y: auto;
}

/* BUTTON */
.btn-new {
    width: 100%;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-new.main {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-new.sub {
    background: var(--hover-bg);
}

/* CONTENT */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* GRID */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.file-card {
    background: white;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
}

.file-card:hover {
    background: var(--hover-bg);
}

.icon {
    font-size: 40px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-thumb {
    max-width: 100%;
    max-height: 70px;
    object-fit: cover;
}

.name {
    font-size: 12px;
    color: var(--text-sub);
}

/* EMPTY */
.empty-msg {
    text-align: center;
    color: var(--text-sub);
}

/* =========================
   IMAGE VIEWER (FIX TOTAL)
========================= */
.viewer {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.95);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 999999; /* paksa di atas semua */
}

/* hidden */
.viewer.hidden {
    display: none !important;
}

/* image */
.viewer img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: grab;
}

/* close button */
.viewer .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

/* navigation */
.viewer .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: white;
    cursor: pointer;
    user-select: none;
}

.viewer .left { left: 20px; }
.viewer .right { right: 20px; }

/* ZOOM BUTTON */
.zoom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.zoom-controls button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
}

.zoom-controls button:hover {
    background: rgba(255,255,255,0.4);
}

/* ======================
   AUTH UI
====================== */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f1f3f4;
    font-family: 'Segoe UI', sans-serif;
}

.auth-box {
    background: white;
    padding: 30px;
    width: 320px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-box h2 {
    margin-bottom: 20px;
}

.auth-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #dadce0;
    border-radius: 6px;
}

.auth-box button {
    width: 100%;
    padding: 10px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.auth-box button:hover {
    background: #1669c1;
}

.auth-link {
    margin-top: 10px;
    font-size: 13px;
}

.auth-link a {
    color: #1a73e8;
    text-decoration: none;
}

.error {
    color: red;
    margin-bottom: 10px;
}

.logout-btn {
    background: #ea4335;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
}

.auth-desc {
    font-size: 13px;
    color: #5f6368;
    margin-bottom: 15px;
}

.btn-resend {
    margin-top: 10px;
    background: #f1f3f4;
    color: #3c4043;
}