* {
    box-sizing: border-box;
}

:root {
    --bg-color: #f0f4f8;
    --sidebar-bg: #ffffff;
    --primary-color: #4285f4;
    --text-color: #333333;
    --border-color: #e0e0e0;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.brand {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #5f6368;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background-color: #e8f0fe;
    color: var(--primary-color);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px;
    padding-top: 80px;
    /* Space for fixed header */
}

/* Global Header */
.main-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 250px;
    /* Match sidebar width */
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align right */
    padding: 0 30px;
    z-index: 900;
    gap: 15px;
    transition: left 0.3s;
}

/* Actions Dropdown */
.actions-dropdown-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f3f4;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5f6368;
    transition: background 0.2s;
}

.actions-dropdown-btn:hover {
    background: #e8eaed;
}


/* Glassmorphism Card */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.btn-primary {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: #3367d6;
}

/* Dashboard Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* New Card Design */
.file-card {
    background: #f8f9fa;
    /* Lighter background */
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 1px solid #efefef;
    /* Subtle border */
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 200px;
    box-shadow: none;
    /* Flat look initially */
}

.file-card:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Folder Specific Styles */
.folder-card {
    height: 48px !important;
    min-height: 48px !important;
    background: #f8f9fa;
    border: 1px solid #efefef;
    border-radius: 8px;
    flex-direction: row;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
}

.folder-card .file-name-text {
    font-size: 14px;
    font-weight: 500;
    color: #444;
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
}

.file-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    flex: 1;
}

.file-type-icon {
    font-size: 20px;
    display: none;
    /* Hide if still present in HTML for some reason */
}

.file-name-text {
    font-size: 13px;
    /* Smaller font */
    font-weight: 600;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Remove max-width to allow flex to handle it, or increase it */
    max-width: 100%;
}

.file-menu-icon {
    color: #5f6368;
    font-size: 14px;
    padding: 4px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
    transition: background 0.2s;
}

.file-menu-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.file-body {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #000;
    /* Black bg for images to pop? Or transparent */
}

.file-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.file-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8eaed;
    /* Light gray placeholder */
    border-radius: 8px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.upload-btn {
    background-color: white;
    color: var(--text-color);
    border: 1px solid #dadce0;
    padding: 10px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-btn:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

/* Explicit Layout Helpers */
#fileList {
    width: 100%;
    display: block !important;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}


.section-title {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-container {
    position: relative;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        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.15);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-header {
        left: 0;
        padding-left: 20px;
        justify-content: space-between;
    }

    .content {
        width: 100%;
        padding: 20px;
        padding-top: 80px;
    }

    /* Toolbar Layout */
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .toolbar-actions {
        width: 100%;
        gap: 12px;
    }

    /* Hide Inline Buttons on Mobile */
    .desktop-only-btn {
        display: none !important;
    }

    /* Search Bar Logic */
    .search-container {
        width: 100%;
        order: -1;
    }

    /* Adjust Search Input logic on mobile if needed */
    #searchInput {
        width: 100% !important;
    }

    #sidebarToggle {
        display: block !important;
    }

    .mobile-logo {
        display: block !important;
        margin-right: auto;
    }
}