/**
 * PushRelay Admin Styles
 * 
 * Professional admin interface styling
 * 
 * @package PushRelay
 * @since 2.0.0
 */

/* ========================================
   VARIABLES & BASE
   ======================================== */
:root {
    --pushrelay-primary: #0073aa;
    --pushrelay-primary-dark: #005177;
    --pushrelay-success: #28a745;
    --pushrelay-warning: #ffc107;
    --pushrelay-danger: #dc3545;
    --pushrelay-info: #17a2b8;
    --pushrelay-light: #f8f9fa;
    --pushrelay-dark: #343a40;
    --pushrelay-border: #ddd;
    --pushrelay-radius: 4px;
    --pushrelay-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ========================================
   LAYOUT & CONTAINERS
   ======================================== */
.pushrelay-container {
    max-width: 1200px;
    margin: 20px 0;
}

.pushrelay-wrap {
    background: #fff;
    padding: 20px;
    border-radius: var(--pushrelay-radius);
    box-shadow: var(--pushrelay-shadow);
    margin-bottom: 20px;
}

.pushrelay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--pushrelay-border);
}

.pushrelay-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--pushrelay-dark);
}

/* ========================================
   DASHBOARD STATS GRID
   ======================================== */
.pushrelay-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pushrelay-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: var(--pushrelay-radius);
    box-shadow: var(--pushrelay-shadow);
    transition: transform 0.2s ease;
}

.pushrelay-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pushrelay-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pushrelay-stat-card .stat-number {
    font-size: 36px;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

.pushrelay-stat-card .stat-change {
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.8;
}

/* Different stat card colors */
.pushrelay-stat-card.card-primary {
    background: linear-gradient(135deg, var(--pushrelay-primary) 0%, var(--pushrelay-primary-dark) 100%);
}

.pushrelay-stat-card.card-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.pushrelay-stat-card.card-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pushrelay-stat-card.card-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.pushrelay-stat-card.card-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pushrelay-stat-card.card-danger {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* ========================================
   TABLES
   ======================================== */
.pushrelay-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.pushrelay-table thead {
    background: var(--pushrelay-light);
}

.pushrelay-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--pushrelay-dark);
    border-bottom: 2px solid var(--pushrelay-border);
}

.pushrelay-table td {
    padding: 12px;
    border-bottom: 1px solid var(--pushrelay-border);
}

.pushrelay-table tbody tr:hover {
    background: #f9f9f9;
}

/* ========================================
   BUTTONS
   ======================================== */
.pushrelay-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--pushrelay-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.pushrelay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pushrelay-btn:active {
    transform: translateY(0);
}

.pushrelay-btn-primary {
    background: var(--pushrelay-primary);
    color: white;
}

.pushrelay-btn-primary:hover {
    background: var(--pushrelay-primary-dark);
    color: white;
}

.pushrelay-btn-success {
    background: var(--pushrelay-success);
    color: white;
}

.pushrelay-btn-success:hover {
    background: #218838;
    color: white;
}

.pushrelay-btn-danger {
    background: var(--pushrelay-danger);
    color: white;
}

.pushrelay-btn-danger:hover {
    background: #c82333;
    color: white;
}

.pushrelay-btn-secondary {
    background: #6c757d;
    color: white;
}

.pushrelay-btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.pushrelay-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.pushrelay-btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.pushrelay-btn-block {
    display: block;
    width: 100%;
}

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

/* ========================================
   BADGES
   ======================================== */
.pushrelay-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pushrelay-badge-success {
    background: #d4edda;
    color: #155724;
}

.pushrelay-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.pushrelay-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.pushrelay-badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.pushrelay-badge-primary {
    background: #cce5ff;
    color: #004085;
}

/* Status badges */
.pushrelay-status-pending {
    background: #fff3cd;
    color: #856404;
}

.pushrelay-status-sent {
    background: #d4edda;
    color: #155724;
}

.pushrelay-status-failed {
    background: #f8d7da;
    color: #721c24;
}

.pushrelay-status-draft {
    background: #e2e3e5;
    color: #383d41;
}

/* Priority badges */
.pushrelay-badge-low {
    background: #d1ecf1;
    color: #0c5460;
}

.pushrelay-badge-medium {
    background: #fff3cd;
    color: #856404;
}

.pushrelay-badge-high {
    background: #f8d7da;
    color: #721c24;
}

.pushrelay-badge-urgent {
    background: #dc3545;
    color: white;
}

/* ========================================
   ALERTS & NOTICES
   ======================================== */
.pushrelay-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--pushrelay-radius);
    border-left: 4px solid;
}

.pushrelay-alert-success {
    background: #d4edda;
    border-color: var(--pushrelay-success);
    color: #155724;
}

.pushrelay-alert-warning {
    background: #fff3cd;
    border-color: var(--pushrelay-warning);
    color: #856404;
}

.pushrelay-alert-danger {
    background: #f8d7da;
    border-color: var(--pushrelay-danger);
    color: #721c24;
}

.pushrelay-alert-info {
    background: #d1ecf1;
    border-color: var(--pushrelay-info);
    color: #0c5460;
}

/* ========================================
   FORMS
   ======================================== */
.pushrelay-form-group {
    margin-bottom: 20px;
}

.pushrelay-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--pushrelay-dark);
}

.pushrelay-form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--pushrelay-border);
    border-radius: var(--pushrelay-radius);
    transition: border-color 0.2s ease;
}

.pushrelay-form-control:focus {
    outline: none;
    border-color: var(--pushrelay-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.pushrelay-form-control:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.pushrelay-form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

/* ========================================
   TABS
   ======================================== */
.pushrelay-tabs {
    display: flex;
    border-bottom: 2px solid var(--pushrelay-border);
    margin-bottom: 20px;
}

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

.pushrelay-tab:hover {
    color: var(--pushrelay-primary);
}

.pushrelay-tab.active {
    color: var(--pushrelay-primary);
    border-bottom-color: var(--pushrelay-primary);
}

.pushrelay-tab-content {
    display: none;
}

.pushrelay-tab-content.active {
    display: block;
}

/* ========================================
   CARDS
   ======================================== */
.pushrelay-card {
    background: white;
    border-radius: var(--pushrelay-radius);
    box-shadow: var(--pushrelay-shadow);
    margin-bottom: 20px;
}

.pushrelay-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--pushrelay-border);
    font-weight: 600;
    color: var(--pushrelay-dark);
}

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

.pushrelay-card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--pushrelay-border);
    background: var(--pushrelay-light);
}

/* ========================================
   HEALTH CHECK
   ======================================== */
.pushrelay-health-score {
    text-align: center;
    padding: 30px;
}

.pushrelay-health-score-value {
    font-size: 72px;
    font-weight: bold;
    line-height: 1;
    margin: 20px 0;
}

.pushrelay-health-score-value.score-good {
    color: var(--pushrelay-success);
}

.pushrelay-health-score-value.score-warning {
    color: var(--pushrelay-warning);
}

.pushrelay-health-score-value.score-bad {
    color: var(--pushrelay-danger);
}

.pushrelay-health-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.pushrelay-health-check-item {
    padding: 15px;
    border-radius: var(--pushrelay-radius);
    border-left: 4px solid;
    background: #f9f9f9;
}

.pushrelay-health-check-item.status-success {
    border-color: var(--pushrelay-success);
}

.pushrelay-health-check-item.status-warning {
    border-color: var(--pushrelay-warning);
}

.pushrelay-health-check-item.status-error {
    border-color: var(--pushrelay-danger);
}

.pushrelay-health-check-title {
    font-weight: 600;
    margin-bottom: 5px;
}

/* ========================================
   LOADING & SPINNERS
   ======================================== */
.pushrelay-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--pushrelay-primary);
    animation: pushrelay-spin 0.8s linear infinite;
}

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

.pushrelay-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pushrelay-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: pushrelay-spin 0.8s linear infinite;
}

/* ========================================
   SETUP WIZARD
   ======================================== */
.pushrelay-setup-wizard {
    max-width: 800px;
    margin: 40px auto;
}

.pushrelay-setup-step {
    background: white;
    padding: 40px;
    border-radius: var(--pushrelay-radius);
    box-shadow: var(--pushrelay-shadow);
    text-align: center;
}

.pushrelay-setup-step h2 {
    margin-top: 0;
    color: var(--pushrelay-primary);
}

.pushrelay-setup-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.pushrelay-setup-progress-item {
    display: flex;
    align-items: center;
}

.pushrelay-setup-progress-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 10px;
}

.pushrelay-setup-progress-item.active .pushrelay-setup-progress-number {
    background: var(--pushrelay-primary);
}

.pushrelay-setup-progress-item.completed .pushrelay-setup-progress-number {
    background: var(--pushrelay-success);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 782px) {
    .pushrelay-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pushrelay-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pushrelay-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .pushrelay-btn-block {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.pushrelay-text-center { text-align: center; }
.pushrelay-text-right { text-align: right; }
.pushrelay-text-left { text-align: left; }

.pushrelay-mt-10 { margin-top: 10px; }
.pushrelay-mt-20 { margin-top: 20px; }
.pushrelay-mt-30 { margin-top: 30px; }

.pushrelay-mb-10 { margin-bottom: 10px; }
.pushrelay-mb-20 { margin-bottom: 20px; }
.pushrelay-mb-30 { margin-bottom: 30px; }

.pushrelay-p-10 { padding: 10px; }
.pushrelay-p-20 { padding: 20px; }
.pushrelay-p-30 { padding: 30px; }

.pushrelay-flex { display: flex; }
.pushrelay-flex-center { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.pushrelay-flex-between { 
    display: flex; 
    justify-content: space-between; 
}

.pushrelay-hidden { display: none; }
.pushrelay-visible { display: block; }

.pushrelay-text-muted { color: #6c757d; }
.pushrelay-text-success { color: var(--pushrelay-success); }
.pushrelay-text-danger { color: var(--pushrelay-danger); }
.pushrelay-text-warning { color: var(--pushrelay-warning); }
.pushrelay-text-info { color: var(--pushrelay-info); }