/**
 * Google Drive Display - Public Styles
 * Best practices: Glassmorphism, Modern CSS Variables, Flex/Grid
 */

:root {
    --gdd-primary-color: #4285F4;
    --gdd-secondary-color: #34A853;
    --gdd-text-color: #202124;
    --gdd-subtext-color: #5f6368;
    --gdd-bg-color: #ffffff;
    --gdd-card-bg: #ffffff;
    --gdd-border-radius: 16px;
    /* Rounded corners */
    --gdd-border-color: #e0e0e0;
    --gdd-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --gdd-hover-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --gdd-transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gdd-container {
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    /* Try to match Google's feel */
    background: transparent;
    max-width: 100%;
    margin: 0 auto;
}

/* Header & Breadcrumbs */
.gdd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 5px;
}

.gdd-breadcrumbs {
    font-size: 18px;
    /* Larger font */
    color: var(--gdd-text-color);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gdd-breadcrumb-item {
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
}

.gdd-breadcrumb-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.gdd-breadcrumb-separator {
    color: var(--gdd-subtext-color);
    font-size: 14px;
}

.gdd-breadcrumb-item.active {
    font-weight: 500;
    cursor: default;
    pointer-events: none;
}

.gdd-btn-icon {
    background: #fff;
    border: 1px solid var(--gdd-border-color);
    cursor: pointer;
    color: var(--gdd-subtext-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gdd-btn-icon:hover {
    background: #f1f3f4;
    color: var(--gdd-text-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Grid Layout */
.gdd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Wider cards */
    gap: 20px;
}

.gdd-item {
    background: var(--gdd-card-bg);
    border: 1px solid var(--gdd-border-color);
    border-radius: var(--gdd-border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: var(--gdd-transition);
    text-decoration: none;
    color: var(--gdd-text-color);
    position: relative;
    overflow: hidden;
    height: 100%;
    /* Uniform height */
}

.gdd-item:hover {
    box-shadow: var(--gdd-hover-shadow);
    transform: translateY(-2px);
    border-color: transparent;
    z-index: 1;
}

/* Thumbnail Area */
.gdd-item-thumb-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    /* Cinematic ratio */
    background: #f8f9fa;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.gdd-item-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gdd-item:hover .gdd-item-thumb-wrapper img {
    transform: scale(1.05);
    /* Zoom effect */
}

/* Fallback Icon inside Thumb Wrapper */
.gdd-item-thumb-wrapper i {
    font-size: 48px;
    color: var(--gdd-subtext-color);
}

/* Content Area */
.gdd-item-content {
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Left align text */
    flex-grow: 1;
}

.gdd-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 4px;
}

.gdd-item-icon-small {
    font-size: 16px;
    min-width: 16px;
}

.gdd-item-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--gdd-text-color);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.gdd-item-meta {
    font-size: 12px;
    color: var(--gdd-subtext-color);
    margin-top: auto;
    /* Push to bottom */
    padding-top: 8px;
}

/* Folder Specifics */
.gdd-item.is-folder .gdd-item-thumb-wrapper {
    background: #e8f0fe;
    /* Light blue for folders */
    aspect-ratio: 3/2;
}

.gdd-item.is-folder .gdd-item-thumb-wrapper i {
    color: var(--gdd-primary-color);
    font-size: 64px;
}

/* Loader */
.gdd-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--gdd-subtext-color);
}

.gdd-spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--gdd-primary-color);
    animation: gdd-spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-bottom: 16px;
}

@keyframes gdd-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* File Type Colors (for small icons) */
.gdd-file-pdf .gdd-item-icon-small {
    color: #ea4335;
}

.gdd-file-doc .gdd-item-icon-small {
    color: #4285F4;
}

.gdd-file-sheet .gdd-item-icon-small {
    color: #34A853;
}

.gdd-file-slide .gdd-item-icon-small {
    color: #fbbc04;
}

.gdd-file-image .gdd-item-icon-small {
    color: #ea4335;
}

.gdd-file-video .gdd-item-icon-small {
    color: #ea4335;
}

/* Vertical Thumbnails for PDFs */
.gdd-item.gdd-file-pdf .gdd-item-thumb-wrapper {
    aspect-ratio: 3/4;
    /* Portrait mode for documents */
    background: #fdfdfd;
}