/* GWD Conex Admin Styles */

/* ============================================================
   LAYOUT & GENERAL
   ============================================================ */

.gwd-connect-wrap .gwd-version {
    font-size: 13px;
    font-weight: normal;
    color: #666;
    vertical-align: middle;
}

.gwd-connect-wrap .nav-tab-wrapper {
    margin-bottom: 20px;
}

.gwd-tab-content {
    padding: 0 10px;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.gwd-status-badge {
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.gwd-status-badge.gwd-enabled {
    color: #46b450;
}

.gwd-status-badge.gwd-disabled {
    color: #dc3232;
}

.gwd-status-badge.gwd-warning {
    color: #dba617;
}

.gwd-status-badge.gwd-pending {
    color: #f56e28;
}

/* Large status indicator for uptime */
.gwd-status-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
}

.gwd-status-large.gwd-up {
    background: #e6f9e8;
    color: #46b450;
}

.gwd-status-large.gwd-down {
    background: #fce4e4;
    color: #dc3232;
}

.gwd-status-large.gwd-slow {
    background: #fff8e1;
    color: #dba617;
}

.gwd-status-large.gwd-pending-status {
    background: #fff3e0;
    color: #f56e28;
}

.gwd-status-large.gwd-unknown {
    background: #f0f0f1;
    color: #666;
}

/* ============================================================
   API KEY & CODE BLOCKS
   ============================================================ */

.gwd-api-key {
    background: #1d2327;
    color: #50c878;
    padding: 8px 12px;
    font-size: 13px;
    display: inline-block;
    max-width: 500px;
    word-break: break-all;
    border-radius: 3px;
}

.gwd-code-block {
    background: #1d2327;
    color: #eee;
    padding: 15px;
    max-width: 800px;
    overflow-x: auto;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================================
   TABLES
   ============================================================ */

.gwd-endpoints-table {
    max-width: 800px;
}

.gwd-endpoints-table td:first-child {
    font-weight: 600;
    width: 70px;
}

.gwd-endpoints-table td:nth-child(2) {
    font-family: monospace;
    width: 200px;
}

/* ============================================================
   CARDS & STATS GRID
   ============================================================ */

.gwd-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0;
    max-width: 1200px;
}

.gwd-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px;
}

.gwd-card-header {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f1;
}

.gwd-card-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.gwd-card-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.gwd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
    max-width: 1200px;
}

.gwd-stat-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    padding: 20px 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.gwd-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

.gwd-stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
}

/* ============================================================
   PROGRESS BAR (Backup)
   ============================================================ */

.gwd-progress-wrap {
    max-width: 600px;
    margin: 16px 0;
}

.gwd-progress-bar-outer {
    background: #f0f0f1;
    border-radius: 4px;
    height: 24px;
    overflow: hidden;
    position: relative;
}

.gwd-progress-bar-inner {
    background: #2271b1;
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.gwd-progress-bar-inner.gwd-progress-success {
    background: #46b450;
}

.gwd-progress-bar-inner.gwd-progress-error {
    background: #dc3232;
}

.gwd-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    white-space: nowrap;
}

.gwd-progress-detail {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.gwd-progress-elapsed {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ============================================================
   BACKUP ARCHIVE TABLE
   ============================================================ */

.gwd-backup-table {
    max-width: 1100px;
}

.gwd-backup-table td {
    vertical-align: middle;
}

.gwd-backup-tier {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f1;
    color: #666;
}

.gwd-backup-tier.gwd-tier-daily {
    background: #e8f0fe;
    color: #1967d2;
}

.gwd-backup-tier.gwd-tier-weekly {
    background: #e6f4ea;
    color: #137333;
}

.gwd-backup-tier.gwd-tier-monthly {
    background: #fce8e6;
    color: #c5221f;
}

/* ============================================================
   LOG SEVERITY BADGES
   ============================================================ */

.gwd-severity-badge {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    text-transform: uppercase;
}

.gwd-severity-fatal {
    background: #dc3232;
    color: #fff;
}

.gwd-severity-error {
    background: #d63638;
    color: #fff;
}

.gwd-severity-warning {
    background: #dba617;
    color: #fff;
}

.gwd-severity-notice {
    background: #72aee6;
    color: #fff;
}

/* Log summary counts — clickable filter badges */
.gwd-log-summary {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
    align-items: center;
}

.gwd-log-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s, box-shadow 0.15s;
    color: #fff;
}

.gwd-log-count:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.gwd-log-count.gwd-filter-inactive {
    opacity: 0.35;
}

.gwd-log-count.gwd-severity-fatal { background: #dc3232; }
.gwd-log-count.gwd-severity-error { background: #d63638; }
.gwd-log-count.gwd-severity-warning { background: #dba617; }
.gwd-log-count.gwd-severity-notice { background: #72aee6; }

/* Timezone controls */
.gwd-log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 12px;
}

.gwd-tz-select {
    font-size: 12px;
    padding: 3px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
}

/* Log table row highlighting */
.gwd-log-row-fatal {
    border-left: 3px solid #dc3232;
}

.gwd-log-row-error {
    border-left: 3px solid #d63638;
}

.gwd-log-row-warning {
    border-left: 3px solid #dba617;
}

.gwd-log-row-notice {
    border-left: 3px solid #72aee6;
}

/* Log type badge */
.gwd-log-type {
    font-family: monospace;
    font-size: 11px;
    color: #666;
    background: #f0f0f1;
    padding: 1px 6px;
    border-radius: 3px;
}

/* ============================================================
   HOURLY DISTRIBUTION CHART (Logs & Uptime)
   ============================================================ */

.gwd-hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 80px;
    max-width: 600px;
    margin: 12px 0;
    padding: 0;
}

.gwd-hourly-bar {
    flex: 1;
    min-width: 0;
    background: #2271b1;
    border-radius: 2px 2px 0 0;
    position: relative;
    transition: height 0.3s ease;
}

.gwd-hourly-bar:hover {
    opacity: 0.8;
}

.gwd-hourly-bar[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
}

.gwd-hourly-labels {
    display: flex;
    gap: 2px;
    max-width: 600px;
    margin-bottom: 8px;
}

.gwd-hourly-label {
    flex: 1;
    text-align: center;
    font-size: 9px;
    color: #999;
}

/* ============================================================
   RESPONSE TIME CHART (Uptime)
   ============================================================ */

.gwd-response-chart {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 100px;
    max-width: 900px;
    margin: 12px 0;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 4px;
}

.gwd-response-bar {
    flex: 1;
    min-width: 1px;
    max-width: 6px;
    border-radius: 1px 1px 0 0;
    transition: height 0.2s ease;
}

.gwd-response-bar.gwd-rt-good {
    background: #46b450;
}

.gwd-response-bar.gwd-rt-ok {
    background: #72aee6;
}

.gwd-response-bar.gwd-rt-slow {
    background: #dba617;
}

.gwd-response-bar.gwd-rt-bad {
    background: #dc3232;
}

.gwd-response-bar.gwd-rt-down {
    background: #dc3232;
    opacity: 0.5;
}

/* ============================================================
   PATTERN TABLE (Logs)
   ============================================================ */

.gwd-pattern-table {
    max-width: 1100px;
}

.gwd-pattern-count {
    font-weight: 700;
    font-size: 14px;
    color: #1d2327;
}

.gwd-pattern-message {
    font-family: monospace;
    font-size: 12px;
    color: #50575e;
    word-break: break-word;
    max-width: 600px;
}

/* ============================================================
   LARGE FILES / EXCLUSIONS (Backup)
   ============================================================ */

.gwd-file-path {
    font-family: monospace;
    font-size: 12px;
    color: #50575e;
    word-break: break-all;
}

.gwd-file-size {
    font-weight: 600;
    white-space: nowrap;
}

.gwd-exclusion-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f0f1;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: monospace;
    margin: 2px;
}

.gwd-exclusion-remove {
    color: #dc3232;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    padding: 0 2px;
}

/* ============================================================
   DISK SPACE BAR (Backup)
   ============================================================ */

.gwd-disk-bar {
    background: #f0f0f1;
    border-radius: 4px;
    height: 20px;
    max-width: 400px;
    overflow: hidden;
    position: relative;
}

.gwd-disk-used {
    height: 100%;
    border-radius: 4px;
    background: #2271b1;
}

.gwd-disk-used.gwd-disk-high {
    background: #dba617;
}

.gwd-disk-used.gwd-disk-critical {
    background: #dc3232;
}

.gwd-disk-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* ============================================================
   ACTIONS & BUTTONS
   ============================================================ */

.gwd-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 16px 0;
    flex-wrap: wrap;
}

.gwd-actions form {
    display: inline;
}

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */

.gwd-section {
    margin-top: 30px;
}

.gwd-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #c3c4c7;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media screen and (max-width: 782px) {
    .gwd-cards-grid {
        grid-template-columns: 1fr;
    }

    .gwd-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gwd-log-summary {
        flex-wrap: wrap;
    }

    .gwd-response-chart {
        height: 60px;
    }
}
