/**
 * GDrive Files - Frontend Styles
 * Matching WP File Download appearance exactly
 */

/* Container */
.gdrive-files-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
}

/* Title */
.gdrive-files-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-left: 4px solid #dc2626;
    color: #333;
}

/* Empty */
.gdrive-files-empty {
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    text-align: center;
}

/* Files Grid - 2 columns like WPFD */
.gdrive-files-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .gdrive-files-list {
        grid-template-columns: 1fr;
    }
}

/* File Card - WPFD style */
.gdrive-file-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.gdrive-file-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Top section with icon and name */
.gdrive-file-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

/* Large PDF Icon like WPFD */
.gdrive-file-icon {
    width: 50px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    background: #dc2626;
    border-radius: 4px;
    position: relative;
}

.gdrive-file-icon::after {
    content: 'PDF';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    background: rgba(0,0,0,0.3);
    padding: 1px 6px;
    border-radius: 2px;
}

.gdrive-file-icon svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* File icon variations */
.gdrive-icon-pdf .gdrive-file-icon {
    background: #dc2626;
}
.gdrive-icon-pdf .gdrive-file-icon::after {
    content: 'PDF';
}

.gdrive-icon-word .gdrive-file-icon {
    background: #2b579a;
}
.gdrive-icon-word .gdrive-file-icon::after {
    content: 'DOC';
}

.gdrive-icon-excel .gdrive-file-icon {
    background: #217346;
}
.gdrive-icon-excel .gdrive-file-icon::after {
    content: 'XLS';
}

.gdrive-icon-image .gdrive-file-icon {
    background: #9333ea;
}
.gdrive-icon-image .gdrive-file-icon::after {
    content: 'IMG';
}

.gdrive-icon-file .gdrive-file-icon {
    background: #6b7280;
}
.gdrive-icon-file .gdrive-file-icon::after {
    content: 'FILE';
}

/* File Info */
.gdrive-file-info {
    flex: 1;
    min-width: 0;
}

.gdrive-file-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.3;
}

.gdrive-file-meta {
    font-size: 12px;
    color: #888;
}

/* Actions - Full width buttons like WPFD */
.gdrive-file-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gdrive-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.gdrive-btn-download {
    background: #22c55e;
    color: #fff !important;
}

.gdrive-btn-download:hover {
    background: #16a34a;
    color: #fff !important;
}

.gdrive-btn-preview {
    background: #f97316;
    color: #fff !important;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.gdrive-btn-preview:hover {
    background: #ea580c;
    color: #fff !important;
}

/* Login Required */
.gdrive-login-required {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
}

/* Folders */
.gdrive-folders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.gdrive-folder-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.gdrive-folder-item:hover {
    background: #fde68a;
}

.gdrive-folder-icon {
    font-size: 20px;
    margin-right: 10px;
}

.gdrive-folder-name {
    font-weight: 500;
    color: #92400e;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .gdrive-files-title {
        background: #374151;
        color: #f3f4f6;
    }
    
    .gdrive-file-item {
        background: #1f2937;
        border-color: #374151;
    }
    
    .gdrive-file-header {
        background: #111827;
        border-bottom-color: #374151;
    }
    
    .gdrive-file-name {
        color: #f3f4f6;
    }
    
    .gdrive-file-meta {
        color: #9ca3af;
    }
}

/* =============================================
   FOLDER BROWSER STYLES
   ============================================= */

.gdrive-browser-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 20px 0;
}

.gdrive-browser-header {
    margin-bottom: 20px;
}

.gdrive-browser-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

/* Breadcrumb */
.gdrive-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 14px;
    padding: 10px 15px;
    background: #f3f4f6;
    border-radius: 6px;
}

.gdrive-breadcrumb-item {
    color: #2563eb;
    text-decoration: none;
}

.gdrive-breadcrumb-item:hover {
    text-decoration: underline;
}

.gdrive-breadcrumb-sep {
    color: #9ca3af;
    margin: 0 3px;
}

/* Browser folders grid - like WPFD screenshot */
.gdrive-browser-folders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.gdrive-browser-folder {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
    cursor: pointer;
}

.gdrive-browser-folder:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.gdrive-browser-folder .gdrive-folder-icon {
    font-size: 18px;
}

.gdrive-browser-folder .gdrive-folder-name {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Browser files grid */
.gdrive-browser-files {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .gdrive-browser-files {
        grid-template-columns: 1fr;
    }
}

.gdrive-browser-file {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.gdrive-browser-file .gdrive-file-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.gdrive-browser-file .gdrive-file-icon {
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
}

.gdrive-browser-file .gdrive-icon-label {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.gdrive-browser-file .gdrive-file-info {
    flex: 1;
    min-width: 0;
}

.gdrive-browser-file .gdrive-file-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    word-break: break-word;
}

.gdrive-browser-file .gdrive-file-meta {
    font-size: 12px;
    color: #888;
}

.gdrive-browser-file .gdrive-file-actions {
    display: flex;
    flex-direction: column;
}

.gdrive-browser-file .gdrive-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.gdrive-browser-file .gdrive-btn-download {
    background: #22c55e;
    color: #fff;
}

.gdrive-browser-file .gdrive-btn-download:hover {
    background: #16a34a;
}

.gdrive-browser-file .gdrive-btn-preview {
    background: #f97316;
    color: #fff;
}

.gdrive-browser-file .gdrive-btn-preview:hover {
    background: #ea580c;
}

/* Loading & Empty states */
.gdrive-loading {
    padding: 40px;
    text-align: center;
    color: #6b7280;
}

.gdrive-empty {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
    background: #f9fafb;
    border-radius: 8px;
}

.gdrive-error {
    padding: 20px;
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 8px;
}

.gdrive-login-notice {
    padding: 20px;
    text-align: center;
    background: #fef3c7;
    color: #92400e;
    border-radius: 8px;
    font-size: 14px;
}
