/* Main Container */
.plugin-data-viewer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #2c3338;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dcdcde;
}

.viewer-header h2 {
    margin: 0;
    color: #1d2327;
    font-size: 24px;
    font-weight: 600;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.view-options {
    display: flex;
    gap: 5px;
    background: #f0f0f1;
    border-radius: 6px;
    padding: 4px;
}

.view-option {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    color: #646970;
    transition: all 0.2s ease;
}

.view-option:hover {
    color: #1d2327;
    background: rgba(0, 0, 0, 0.05);
}

.view-option.active {
    background: white;
    color: #1d2327;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.refresh-button {
    padding: 8px 16px;
    background-color: #3858e9;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-button:hover {
    background-color: #1d48e1;
}

.refresh-button svg {
    stroke: white;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3858e9;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notices */
.plugin-data-viewer-notice {
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    text-align: center;
    border-left: 4px solid #3858e9;
}

.plugin-data-viewer-notice a {
    color: #3858e9;
    text-decoration: none;
    font-weight: 500;
}

.plugin-data-viewer-notice a:hover {
    text-decoration: underline;
}

/* Author Info */
.author-info {
    font-size: 14px;
    color: #646970;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Grid View */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.plugin-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

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

.plugin-card-header {
    padding: 16px;
    background-color: #f8f9f9;
    border-bottom: 1px solid #e2e4e7;
    display: flex;
    align-items: center;
    gap: 12px;
}

.plugin-icon {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: contain;
    background: white;
    padding: 3px;
    border: 1px solid #e2e4e7;
}

.plugin-name {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    color: #1d2327;
    line-height: 1.4;
}

.plugin-card-body {
    padding: 16px;
    flex-grow: 1;
}

.plugin-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 12px;
    color: #646970;
    margin-bottom: 4px;
    font-weight: 500;
}

.meta-value {
    font-weight: 500;
    font-size: 14px;
    color: #1d2327;
}

.plugin-description {
    font-size: 14px;
    line-height: 1.5;
    color: #3c434a;
    margin-bottom: 16px;
}

.plugin-card-footer {
    padding: 12px 16px;
    background-color: #f8f9f9;
    border-top: 1px solid #e2e4e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plugin-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-badge svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

.installs-badge {
    background-color: #f0f5ff;
    color: #1a4fb3;
}

.downloads-badge {
    background-color: #f0f9f0;
    color: #1a7f1a;
}

.rating-badge {
    background-color: #fff8e6;
    color: #996600;
}

.plugin-link {
    color: #3858e9;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.plugin-link:hover {
    text-decoration: underline;
}

.plugin-link svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

/* Table View */
.table-view {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.table-view thead th {
    background-color: #3858e9;
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
}

.table-view thead th:first-child {
    border-top-left-radius: 10px;
}

.table-view thead th:last-child {
    border-top-right-radius: 10px;
}

.table-view tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
    font-size: 14px;
}

.table-view tbody tr:last-child td {
    border-bottom: none;
}

.table-view tbody tr:hover {
    background-color: #f8f9f9;
}

.table-view .plugin-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-view .plugin-icon {
    width: 36px;
    height: 36px;
}

.table-view .plugin-actions {
    display: flex;
    gap: 8px;
}

.table-view .action-button {
    background: transparent;
    border: none;
    color: #3858e9;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

.table-view .action-button:hover {
    background: #f0f5ff;
}

/* List View */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.list-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.list-item-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.list-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    background: white;
    padding: 2px;
    border: 1px solid #e2e4e7;
}

.list-item-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.list-item-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.list-item-description {
    font-size: 14px;
    line-height: 1.6;
    color: #3c434a;
    margin: 0;
}

.list-item-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.list-item-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.empty-state-icon {
    font-size: 48px;
    color: #dcdcde;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    color: #1d2327;
    margin-bottom: 8px;
}

.empty-state-description {
    color: #646970;
    margin-bottom: 16px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .viewer-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .list-item-body {
        grid-template-columns: 1fr;
    }
    
    .table-view {
        display: block;
        overflow-x: auto;
    }
    
    .table-view thead th {
        white-space: nowrap;
    }
    
    .table-view tbody td {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .grid-view {
        grid-template-columns: 1fr;
    }
    
    .plugin-meta {
        grid-template-columns: 1fr;
    }
    
    .list-item-meta {
        grid-template-columns: 1fr;
    }
}