/* CBS File Browser Enhanced Styles */
#cbsfb-browser {
    max-width: 900px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cbsfb-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.cbsfb-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cbsfb-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cbsfb-back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cbsfb-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.cbsfb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cbsfb-breadcrumb-item {
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.cbsfb-breadcrumb-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.cbsfb-breadcrumb-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.cbsfb-breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.cbsfb-content {
    padding: 0;
    max-height: 600px;
    overflow-y: auto;
}

.cbsfb-content::-webkit-scrollbar {
    width: 8px;
}

.cbsfb-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cbsfb-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.cbsfb-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.cbsfb-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0;
}

.cbsfb-grid-header {
    display: contents;
}

.cbsfb-grid-header > div {
    background: #f8f9fa;
    padding: 15px 20px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cbsfb-item {
    display: contents;
    transition: all 0.2s ease;
}

.cbsfb-item > div {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.cbsfb-item:hover > div {
    background: #f8f9ff;
    border-color: #e3e8ff;
}

.cbsfb-item.folder > div:first-child {
    cursor: pointer;
    font-weight: 500;
}

.cbsfb-item.folder:hover > div:first-child {
    color: #667eea;
}

.cbsfb-file-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cbsfb-file-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.cbsfb-file-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cbsfb-file-link {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cbsfb-file-link:hover {
    color: #667eea;
}

.cbsfb-size, .cbsfb-modified {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
}

.cbsfb-loading {
    padding: 60px 20px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
}

.cbsfb-loading::before {
    content: "⏳";
    font-size: 24px;
    display: block;
    margin-bottom: 10px;
}

.cbsfb-error {
    padding: 40px 20px;
    text-align: center;
    color: #dc3545;
    background: #ffeaea;
    border: 1px solid #f5c6cb;
    margin: 20px;
    border-radius: 6px;
}

.cbsfb-empty {
    padding: 60px 20px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
}

.cbsfb-empty::before {
    content: "📁";
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    #cbsfb-browser {
        margin: 10px;
        border-radius: 8px;
    }
    
    .cbsfb-header {
        padding: 20px;
    }
    
    .cbsfb-title {
        font-size: 20px;
    }
    
    .cbsfb-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cbsfb-grid {
        grid-template-columns: 1fr auto;
    }
    
    .cbsfb-grid-header > div:last-child,
    .cbsfb-item > div:last-child {
        display: none;
    }
    
    .cbsfb-item > div {
        padding: 12px 15px;
    }
    
    .cbsfb-file-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cbsfb-grid {
        grid-template-columns: 1fr;
    }
    
    .cbsfb-grid-header > div:nth-child(2),
    .cbsfb-item > div:nth-child(2) {
        display: none;
    }
}