/**
 * Plugin Vault Frontend Styles
 * 
 * @package PluginVault
 * @version 1.0.0
 */

/* Dashboard Container */
.pv-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Stats Row */
.pv-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pv-stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.pv-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1;
}

.pv-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Buttons */
.pv-actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Buttons */
.pv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pv-btn-primary {
    background: #1e3a5f;
    color: #fff;
}

.pv-btn-primary:hover {
    background: #2d4a6f;
}

.pv-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.pv-btn-secondary:hover {
    background: #e5e7eb;
}

.pv-btn-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.pv-btn-danger:hover {
    background: #fecaca;
}

.pv-btn-github {
    background: #24292e;
    color: #fff;
}

.pv-btn-github:hover {
    background: #373e47;
}

.pv-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.pv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Settings Panel */
.pv-settings-panel {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.pv-settings-panel h3 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    color: #1e3a5f;
}

.pv-settings-panel h4 {
    margin: 24px 0 12px 0;
    font-size: 1rem;
    color: #374151;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.pv-setting-row {
    margin-bottom: 16px;
}

.pv-setting-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.pv-setting-row small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.pv-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.pv-input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

/* Tabs */
.pv-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.pv-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.pv-tab:hover {
    color: #1e3a5f;
}

.pv-tab.active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
}

/* Table */
.pv-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pv-table th,
.pv-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.pv-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pv-table td {
    font-size: 14px;
    color: #1f2937;
}

.pv-table tbody tr:hover {
    background: #f9fafb;
}

.pv-plugin-author {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Badges */
.pv-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pv-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.pv-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.pv-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.pv-badge-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.pv-badge-github {
    background: #24292e;
    color: #fff;
}

/* Backup Groups */
.pv-backup-group {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.pv-backup-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.pv-backup-group-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #1e3a5f;
}

.pv-version-count {
    font-size: 12px;
    color: #6b7280;
}

.pv-backup-versions {
    padding: 12px;
}

.pv-backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f9fafb;
    flex-wrap: wrap;
    gap: 12px;
}

.pv-backup-item:last-child {
    margin-bottom: 0;
}

.pv-backup-item.pv-latest {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.pv-backup-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pv-version {
    font-weight: 600;
    color: #1e3a5f;
}

.pv-backup-date,
.pv-backup-size {
    font-size: 12px;
    color: #6b7280;
}

.pv-backup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Empty State */
.pv-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
}

.pv-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.pv-empty-state p {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

/* Loading Overlay */
.pv-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pv-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: pv-spin 1s linear infinite;
}

@keyframes pv-spin {
    to { transform: rotate(360deg); }
}

.pv-loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

/* Toast Notifications */
.pv-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

.pv-toast {
    background: #1e3a5f;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: pv-slideIn 0.3s ease;
    max-width: 350px;
}

.pv-toast-success {
    background: #065f46;
}

.pv-toast-error {
    background: #b91c1c;
}

.pv-toast-info {
    background: #1e40af;
}

@keyframes pv-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error Message */
.pv-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .pv-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pv-table th,
    .pv-table td {
        padding: 8px 12px;
    }
    
    .pv-backup-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pv-backup-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
