/* doyo-mesh Public Styles */

/* ============================================================
   Agent Card
   ============================================================ */
.dm-agent-card {
    border: 1px solid #e2e2e8;
    padding: 16px;
    border-radius: 8px;
    margin: 8px 0;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.dm-agent-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* Card Header */
.dm-agent-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.dm-agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.dm-agent-card-title-group {
    flex: 1;
    min-width: 0;
}

.dm-agent-title {
    margin: 0 0 2px 0;
    font-size: 16px;
    line-height: 1.3;
}

.dm-agent-title a {
    text-decoration: none;
    color: #1a1a2e;
}

.dm-agent-title a:hover {
    text-decoration: underline;
}

.dm-agent-role {
    font-size: 13px;
    color: #666;
    display: block;
}

.dm-agent-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Status Dot */
.dm-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    flex-shrink: 0;
}
.dm-status-active   { background: #2ecc71; }
.dm-status-inactive { background: #e67e22; }
.dm-status-draft    { background: #bdc3c7; }

/* Provider Badge */
.dm-provider.badge {
    background: #eef2ff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #4f46e5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Version Badge */
.dm-version-badge {
    background: #f0f0f5;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    font-family: monospace;
}

/* Endpoint display */
.dm-agent-endpoint {
    margin-bottom: 10px;
    font-size: 12px;
    color: #555;
}

.dm-agent-endpoint code {
    font-size: 12px;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
}

/* Description */
.dm-agent-description p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Skills */
.dm-agent-skills {
    margin-bottom: 8px;
}

.dm-agent-skills strong {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.dm-skill {
    background: #f6f6fa;
    margin: 2px 4px 2px 0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    color: #333;
    border: 1px solid #e8e8ee;
}

/* Tags */
.dm-agent-tags {
    margin-top: 6px;
}

.dm-tag {
    display: inline-block;
    background: #f0fdf4;
    color: #166534;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
    border: 1px solid #bbf7d0;
}

/* ============================================================
   Agent Directory Grid
   ============================================================ */
.dm-agent-directory {
    display: grid;
    gap: 16px;
}
.dm-agent-directory.cols-1 { grid-template-columns: 1fr; }
.dm-agent-directory.cols-2 { grid-template-columns: repeat(2, 1fr); }
.dm-agent-directory.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dm-agent-directory.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .dm-agent-directory.cols-2,
    .dm-agent-directory.cols-3,
    .dm-agent-directory.cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .dm-agent-directory.cols-3,
    .dm-agent-directory.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   Layout Variants
   ============================================================ */
.dm-agent-card.layout-compact {
    padding: 10px 14px;
}

.dm-agent-card.layout-compact .dm-agent-card-header {
    margin-bottom: 4px;
}

.dm-agent-card.layout-compact .dm-agent-avatar {
    width: 32px;
    height: 32px;
}

.dm-agent-card.layout-compact .dm-agent-title {
    font-size: 14px;
}

.dm-agent-card.layout-compact .dm-agent-description,
.dm-agent-card.layout-compact .dm-agent-tags {
    display: none;
}

.dm-agent-card.layout-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dm-agent-card.layout-row .dm-agent-card-header {
    margin-bottom: 0;
    min-width: 200px;
}

.dm-agent-card.layout-row .dm-agent-description {
    flex: 1;
    margin-bottom: 0;
}

.dm-agent-card.layout-row .dm-agent-description p {
    margin: 0;
}

/* ============================================================
   Gamify Layout — Game-character card style
   ============================================================ */
.dm-gamify-card {
    position: relative;
    padding: 20px;
    border-width: 2px;
    border-style: solid;
    border-radius: 12px;
    background: linear-gradient(180deg, #fafafe 0%, #f0f0f8 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.dm-gamify-border-active   { border-color: #c8a44e; box-shadow: 0 0 0 1px rgba(200,164,78,0.2), 0 4px 16px rgba(200,164,78,0.1); }
.dm-gamify-border-draft    { border-color: #b0b0b8; box-shadow: 0 0 0 1px rgba(176,176,184,0.15), 0 4px 12px rgba(0,0,0,0.04); }
.dm-gamify-border-inactive { border-color: #c0392b; box-shadow: 0 0 0 1px rgba(192,57,43,0.15), 0 4px 12px rgba(192,57,43,0.06); }

.dm-gamify-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.dm-gamify-avatar-frame {
    position: relative;
    flex-shrink: 0;
}
.dm-gamify-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e8;
}
.dm-gamify-level {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #1a1a2e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    line-height: 1.2;
    font-family: monospace;
    border: 1px solid #fff;
}

.dm-gamify-title-block {
    flex: 1;
    min-width: 0;
}
.dm-gamify-title {
    margin: 0 0 2px 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}
.dm-gamify-title a {
    text-decoration: none;
    color: #1a1a2e;
}
.dm-gamify-title a:hover {
    text-decoration: underline;
}
.dm-gamify-role {
    font-size: 12px;
    color: #888;
    display: block;
}

.dm-gamify-status {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.dm-gamify-status-active   { background: #e8f8e8; color: #1a7a1a; border: 1px solid #b8e8b8; }
.dm-gamify-status-draft    { background: #f0f0f0; color: #777; border: 1px solid #ddd; }
.dm-gamify-status-inactive { background: #fde8e8; color: #b33; border: 1px solid #f5c8c8; }

.dm-gamify-description p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.dm-gamify-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.dm-gamify-stat {
    text-align: center;
    background: #fff;
    border: 1px solid #e8e8ee;
    border-radius: 8px;
    padding: 6px 14px;
    min-width: 70px;
}
.dm-gamify-stat-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}
.dm-gamify-stat-value {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.dm-gamify-section-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 6px;
}
.dm-gamify-skills {
    margin-bottom: 10px;
}
.dm-gamify-skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.dm-gamify-skill-name {
    font-size: 12px;
    color: #444;
    min-width: 90px;
    flex-shrink: 0;
}
.dm-gamify-skill-bar-bg {
    flex: 1;
    height: 8px;
    background: #e8e8ee;
    border-radius: 4px;
    overflow: hidden;
}
.dm-gamify-skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.dm-gamify-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.dm-gamify-tag {
    font-size: 10px;
    padding: 2px 8px;
    background: #f0f0f5;
    border-radius: 4px;
    color: #666;
}

/* ============================================================
   Terminal Layout — Monochrome terminal aesthetic
   ============================================================ */
.dm-terminal-card {
    background: #0d0d12;
    color: #c0c0cc;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 0;
    border: none;
    border-radius: 0;
    margin: 8px 0;
}
.dm-terminal-border-top,
.dm-terminal-border-bottom {
    color: #4a4a5a;
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 0;
}
.dm-terminal-line {
    padding: 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dm-terminal-desc {
    white-space: normal;
}
.dm-terminal-prompt {
    color: #50fa7b;
    margin-right: 8px;
}
.dm-terminal-userhost {
    color: #f1fa8c;
    text-decoration: none;
}
.dm-terminal-userhost:hover {
    text-decoration: underline;
    color: #ffb86c;
}
.dm-terminal-key {
    color: #8be9fd;
    margin-right: 4px;
}
.dm-terminal-value {
    color: #c0c0cc;
    margin-right: 8px;
}
.dm-terminal-sep {
    color: #4a4a5a;
    margin-right: 8px;
}
.dm-terminal-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.dm-terminal-dot-active   { background: #50fa7b; }
.dm-terminal-dot-draft    { background: #6272a4; }
.dm-terminal-dot-inactive { background: #ff5555; }

.dm-terminal-skills {
    padding: 0 12px;
}
.dm-terminal-skill-line {
    padding-left: 20px;
}
.dm-terminal-bullet {
    color: #ff79c6;
    margin-right: 6px;
}
.dm-terminal-skill-name {
    color: #f1fa8c;
}
.dm-terminal-skill-desc {
    color: #6272a4;
    font-size: 12px;
}
.dm-terminal-tag {
    color: #8be9fd;
    margin-right: 6px;
}
.dm-terminal-tag::before {
    content: '#';
    color: #4a4a5a;
}

@media (max-width: 600px) {
    .dm-terminal-line {
        white-space: normal;
        padding: 0 8px;
    }
    .dm-terminal-border-top,
    .dm-terminal-border-bottom {
        font-size: 10px;
    }
}
