/* assets/onedrive-frontend.css */

/* Container */
.onedrive-container {
    max-width: 100%;
    margin: 20px 0;
}

/* Toolbar */
.onedrive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    flex-wrap: wrap;
    gap: 10px;
}

.onedrive-search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.onedrive-search {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-width: 250px;
}

.onedrive-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.onedrive-sort {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
    cursor: pointer;
}

/* Preview Tooltip */
.onedrive-preview-tooltip {
    position: fixed;
    z-index: 9999;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-width: 400px;
    max-height: 400px;
}

.onedrive-preview-tooltip img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
}

.onedrive-toolbar button {
    padding: 8px 16px;
    border: none;
    background: #41786F;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    margin: 0 5px;
}

.onedrive-toolbar button:hover {
    background: #2a5047;
}

.onedrive-view-switcher button.active {
    background: #2a5047;
    font-weight: bold;
}

/* Loading */
.onedrive-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Error */
.onedrive-error {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
}

/* Grid View */
.onedrive-grid {
    display: grid;
    gap: 20px;
    padding: 20px 0;
}

.onedrive-grid-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.onedrive-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.onedrive-grid-icon {
    height: 60px;
    margin-bottom: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.onedrive-filename {
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-word;
}

.onedrive-fileinfo {
    font-size: 12px;
    color: #666;
}

/* List View */
.onedrive-list {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.onedrive-list th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.onedrive-list td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

/* Alternate row colors */
.onedrive-list tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.onedrive-list tbody tr:hover {
    background-color: #e8f4f1;
}

/* Search highlight */
.highlight {
    background-color: #ffeb3b;
    padding: 2px 0;
    font-weight: bold;
}

.onedrive-list-icon {
    font-size: 20px;
    vertical-align: middle;
    margin-right: 8px;
}

.onedrive-actions button {
    padding: 4px 12px;
    margin: 0 2px;
    border: none;
    background: #41786F;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.onedrive-actions button:hover {
    background: #2a5047;
}

/* Custom Card View */
.onedrive-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.onedrive-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.onedrive-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.onedrive-card-header {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
}

.onedrive-card-icon {
    font-size: 48px;
}

.onedrive-card-body {
    padding: 20px;
}

.onedrive-card-body h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.onedrive-card-meta {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.onedrive-card-footer {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.onedrive-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.onedrive-btn-primary {
    background: #41786F;
    color: white;
}

.onedrive-btn-primary:hover {
    background: #2a5047;
}

.onedrive-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.onedrive-btn-secondary:hover {
    background: #d0d0d0;
}

/* Search and toolbar responsive */
@media (max-width: 768px) {
    .onedrive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .onedrive-cards {
        grid-template-columns: 1fr;
    }
    
    .onedrive-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .onedrive-search-wrapper {
        width: 100%;
        flex-direction: column;
    }
    
    .onedrive-search {
        width: 100%;
        min-width: unset;
    }
    
    .onedrive-controls {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .onedrive-sort {
        width: 100%;
    }
    
    .onedrive-list {
        font-size: 14px;
    }
    
    /* Hide actions column on mobile to save space */
    .onedrive-list th:nth-child(3),
    .onedrive-list td:nth-child(3) {
        display: none;
    }
}