/* Plugin Management Styles */
.plugin-management-container {
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .plugin-management-container {
        padding: 2rem;
    }
}

.header-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bs-primary);
}

.page-title {
    color: var(--bs-primary);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--bs-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.plugins-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* Responsive grid for plugins */
@media (min-width: 768px) {
    .plugins-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .plugins-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .plugins-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.plugin-card {
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.plugin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.plugin-card.enabled {
    border-color: var(--bs-success);
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.05) 0%, transparent 100%);
}

.plugin-card.disabled {
    border-color: var(--bs-secondary);
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.05) 0%, transparent 100%);
}

.plugin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.plugin-info {
    flex: 1;
    margin-right: 1rem;
}

.plugin-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

.plugin-description {
    color: var(--bs-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0;
}

.plugin-toggle {
    flex-shrink: 0;
}

.plugin-toggle .form-check-input {
    width: 3rem;
    height: 1.5rem;
}

.plugin-toggle .form-check-label {
    font-weight: 500;
    margin-left: 0.5rem;
}

.plugin-details {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 1rem;
}

.plugin-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--bs-secondary);
}

.stat-item .bi {
    font-size: 0.875rem;
}

.plugin-functions {
    margin-top: 1rem;
}

.functions-list {
    background: rgba(var(--bs-secondary-rgb), 0.1);
    border-radius: 8px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.function-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
}

.function-item:last-child {
    border-bottom: none;
}

.function-description {
    color: var(--bs-secondary);
    font-style: italic;
}

.function-params {
    color: var(--bs-info);
    font-size: 0.875rem;
}

.plugin-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bs-body-bg-rgb), 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

.loading-container {
    text-align: center;
    padding: 3rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--bs-secondary);
}

.summary-section {
    background: var(--bs-light);
    border-radius: 12px;
    padding: 1.5rem;
}

.summary-card {
    text-align: center;
    padding: 1rem;
    background: var(--bs-body-bg);
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

.summary-card h6 {
    color: var(--bs-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-primary);
}

/* Discovery Status Modal */
.discovery-status {
    padding: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-indicator.working {
    background: rgba(25, 135, 84, 0.1);
    color: var(--bs-success);
    border: 1px solid var(--bs-success);
}

.status-indicator.not-working {
    background: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
    border: 1px solid var(--bs-danger);
}

/* Responsive Design */
@media (max-width: 768px) {
    .plugin-management-container {
        padding: 1rem;
    }
    
    .plugins-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .plugin-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .plugin-info {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .plugin-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .plugin-card.enabled {
        background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, transparent 100%);
    }
    
    .plugin-card.disabled {
        background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, transparent 100%);
    }
    
    .functions-list {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .summary-section {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Animation for plugin state changes */
.plugin-card {
    transition: all 0.3s ease, border-color 0.5s ease, background 0.5s ease;
}

.plugin-toggle .form-check-input {
    transition: all 0.3s ease;
}

/* Loading states */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Badge styles */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Alert improvements */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert .bi {
    font-size: 1.1rem;
}

/* Button improvements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Table responsive improvements for Plugin Management */
.plugin-management .table-responsive {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    width: 100%;
    overflow-x: auto;
}

.plugin-management .table {
    width: 100%;
    min-width: 800px; /* Ensure table doesn't get too cramped */
}

.plugin-management .table th {
    background-color: var(--bs-light);
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    white-space: nowrap;
}

.plugin-management .table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

/* Mobile responsive adjustments for table */
@media (max-width: 767px) {
    .plugin-management .table th:nth-child(3),
    .plugin-management .table td:nth-child(3) {
        display: none; /* Hide description column on mobile */
    }

    .plugin-management .table th:nth-child(5),
    .plugin-management .table td:nth-child(5) {
        display: none; /* Hide last modified column on mobile */
    }

    .plugin-management .table {
        min-width: 500px; /* Reduce minimum width for mobile */
    }
}
