:root {
    --bg-color: #f7f9fc;
    --sidebar-bg: #ffffff;
    --text-color: #1f1f1f;
    --text-secondary: #444746;
    --primary: #00bcd4;
    /* Cyan to match KrizVibe */
    /* Google Blue */
    --primary-hover: #00acc1;
    --border: #e0e3e7;
    --hover-bg: #f0f4f8;
    --selected-bg: #e0f7fa;
    --selected-text: #006064;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Google Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

/* Utils */
.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Overlay & Login */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    width: 360px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.login-logo {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.login-box h2 {
    font-family: 'Google Sans';
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 1.5rem;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid #747775;
    border-radius: 4px;
    outline: none;
    transition: 0.2s;
}

.login-box input:focus {
    border-color: var(--primary);
    border-width: 2px;
    padding: 11px 15px;
}

.primary-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 500;
    font-family: 'Google Sans';
    cursor: pointer;
    transition: 0.2s;
}

.primary-btn:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: var(--primary-hover);
}

/* File Viewer Overlay */
.viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.viewer-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    color: white;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
}

.viewer-header span {
    font-weight: 500;
    font-size: 1.1rem;
}

.viewer-controls button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    margin-left: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.viewer-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.viewer-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
}

.viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.viewer-content video {
    max-width: 100%;
    max-height: 100%;
    outline: none;
}

.viewer-content iframe {
    width: 80%;
    height: 90%;
    border: none;
    background: white;
    border-radius: 8px;
}

/* Navbar */
.navbar {
    height: 64px;
    background: var(--surface);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    position: relative;
    z-index: 20;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.navbar .logo {
    display: flex;
    align-items: center;
    padding-right: 48px;
    min-width: 256px;
    text-decoration: none;
    cursor: default;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-color);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo-highlight {
    font-weight: 500;
    color: var(--primary);
}

.search-container {
    flex-grow: 1;
    max-width: 720px;
}

.search-bar {
    background: #e9eef6;
    height: 48px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    transition: 0.2s;
}

.search-bar:focus-within {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-bar button {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
}

.search-bar button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.search-bar input {
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    color: var(--text-color);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    font-weight: bold;
}

/* Layout */
.main-container {
    display: flex;
    height: calc(100vh - 64px);
    background: var(--surface);
}

/* Sidebar */
.sidebar {
    width: 256px;
    padding: 8px 16px;
    padding-right: 0;
    display: flex;
    flex-direction: column;
}

.new-btn {
    width: 100px;
    height: 48px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 16px;
    border: none;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: 0.2s;
    color: var(--primary-hover);
}

.new-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: #e0f7fa;
}

.menu {
    list-style: none;
}

.menu li {
    padding: 8px 12px 8px 24px;
    height: 40px;
    border-radius: 0 20px 20px 0;
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.menu li:hover {
    background: var(--hover-bg);
}

.menu li.active {
    background: var(--selected-bg);
    color: var(--selected-text);
}

.menu li.disabled {
    opacity: 0.6;
    cursor: default;
}

.storage-info {
    margin-top: auto;
    padding: 16px 24px;
    padding-left: 14px;
    margin-bottom: 20px;
}

.cloud-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.storage-info .bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 8px 0;
    overflow: hidden;
}

.storage-info .fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
}

.storage-info .small-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Main Content */
.content-area {
    flex-grow: 1;
    background: var(--surface);
    border-radius: 16px 0 0 0;
    /* Modern curved corner */
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.breadcrumbs {
    font-family: 'Google Sans';
    font-size: 1.1rem;
    color: var(--text-color);
}

.breadcrumbs span {
    cursor: pointer;
}

.breadcrumbs .sep {
    margin: 0 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-bar {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

/* Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

.grid-item {
    background: #f7f9fc;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: 0.1s;
    height: 180px;
    position: relative;
    border: 1px solid transparent;
}

.grid-item:hover {
    background: #e9eef6;
}

.grid-item.selected {
    background: #c2e7ff;
    border-color: var(--primary);
}

/* Folder Look */
.grid-item.type-folder {
    height: 48px;
    flex-direction: row;
    align-items: center;
    padding: 0 16px;
    background: #f7f9fc;
    border: 1px solid var(--border);
}

.grid-item.type-folder:hover {
    background: #e9eef6;
    border-color: transparent;
}

.grid-item.type-folder .thumbnail {
    display: none;
}

.grid-item.type-folder .icon-container {
    color: #5f6368;
    font-size: 1.2rem;
    margin-right: 12px;
}

.grid-item.type-folder .name-area {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* File Look */
.grid-item.type-file .thumbnail {
    flex-grow: 1;
    background: white;
    border-radius: 4px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--primary);
    font-size: 3rem;
}

.grid-item.type-file .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item.type-file .name-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.grid-item.type-file .file-icon {
    color: var(--primary);
    font-size: 1rem;
}

.grid-item.type-file .name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Context Menu */
.context-menu,
.dropdown-menu {
    position: absolute;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 6px 0;
    z-index: 2000;
    display: none;
    min-width: 200px;
}

.context-menu .item,
.dropdown-menu .item {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
}

.context-menu .item:hover,
.dropdown-menu .item:hover {
    background: var(--hover-bg);
}

.context-menu .item.disabled,
.dropdown-menu .item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.context-menu i,
.dropdown-menu i {
    width: 20px;
    color: var(--text-secondary);
    text-align: center;
}

@media (max-width: 768px) {
    #menu-toggle {
        display: block !important;
    }

    .navbar .logo-text {
        display: none;
    }

    .navbar .logo {
        min-width: auto;
        padding-right: 12px;
    }

    /* Search Bar shrink */
    .search-container {
        margin: 0 10px;
    }

    .user-actions .avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    /* Mobile Sidebar */
    .sidebar {
        position: fixed;
        top: 64px;
        /* Below navbar */
        left: 0;
        bottom: 0;
        width: 260px;
        background: white;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
        padding-right: 16px;
        /* Restore padding */
    }

    .sidebar.mobile-active {
        transform: translateX(0);
        display: flex;
        /* Ensure it's flex */
    }

    /* Overlay for content if needed, but for now we rely on click-away */

    .content-area {
        border-radius: 0;
        padding: 12px;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .grid-item {
        height: 140px;
    }

    .grid-item.type-folder {
        height: 56px;
    }

    .grid-item.type-file .thumbnail {
        font-size: 2rem;
    }
}