/* Approval Tab Specific Styles */
.approval-row {
    transition: background-color 0.2s;
}

.approval-row:hover {
    background-color: rgba(212, 165, 116, 0.05);
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-approve:hover {
    filter: brightness(1.3);
}

.btn-reject:hover {
    filter: brightness(1.3);
}

.btn-view:hover {
    filter: brightness(1.3);
}

.diff-preview-row {
    background-color: var(--bg-tertiary);
}

.diff-preview {
    padding: 16px;
}

.diff-preview h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.diff-preview h6 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.diff-info {
    color: var(--text-secondary);
    font-size: 12px;
}

.changed-files ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.changed-files li {
    padding: 4px 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 4px;
}

.changed-files code {
    color: var(--accent-color);
    font-size: 12px;
}

.diff-truncated {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
}

/* Monitoring Tab Styles */
.monitoring-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

/* Pulse Animation for Stat Cards */
.stat-card.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(212, 165, 116, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(212, 165, 116, 0);
    }
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-left: 3px solid transparent;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    animation: activitySlideIn 0.3s ease-out;
}

@keyframes activitySlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-item:hover {
    background-color: rgba(212, 165, 116, 0.1);
}

.activity-time {
    color: var(--text-secondary);
    min-width: 70px;
    font-size: 12px;
}

.activity-msg {
    flex: 1;
    color: var(--text-primary);
}

/* Activity Item Types */
.activity-item.info {
    border-left-color: var(--info-color);
}

.activity-item.success {
    border-left-color: var(--success-color);
}

.activity-item.warning {
    border-left-color: var(--warning-color);
}

.activity-item.error {
    border-left-color: var(--error-color);
}

.activity-item.request {
    border-left-color: #a78bfa;
    /* Purple */
}

.activity-item.response {
    border-left-color: #34d399;
    /* Green */
}

/* Sessions List */
.sessions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.session-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
}

.session-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.session-id {
    font-weight: 600;
    color: var(--text-primary);
}

.session-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.session-status.active {
    background-color: rgba(74, 222, 128, 0.2);
    color: var(--success-color);
}

.session-status.idle {
    background-color: rgba(251, 191, 36, 0.2);
    color: var(--warning-color);
}

.session-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Events List */
.events-list {
    max-height: 500px;
    overflow-y: auto;
}

.event-item {
    background-color: var(--bg-tertiary);
    border-left: 4px solid transparent;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.event-item:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.1);
}

.event-item.success {
    border-left-color: var(--success-color);
}

.event-item.error {
    border-left-color: var(--error-color);
}

.event-item.warning {
    border-left-color: var(--warning-color);
}

.event-item.info {
    border-left-color: var(--info-color);
}

.event-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.event-icon {
    font-size: 18px;
}

.event-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.event-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background-color: rgba(212, 165, 116, 0.2);
    color: var(--accent-color);
}

.event-content {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

/* Live Indicator Animation */
.tab-button[data-tab="monitoring"]::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    margin-right: 8px;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ===== Schedules Tab Styles ===== */

.schedules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.schedules-header h2 {
    margin: 0;
}

/* ========================================
   Projects Tab Styles
   ======================================== */

.source-root {
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--success-color);
}

input:checked+.toggle-slider:before {
    transform: translateX(18px);
}

/* Project Name Cell */
.project-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-icon {
    font-size: 18px;
}

.project-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* Project Type Badge */
.project-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-java {
    background: #f89820;
    color: #000;
}

.type-python {
    background: #3776ab;
    color: #fff;
}

.type-node {
    background: #339933;
    color: #fff;
}

.type-rust {
    background: #dea584;
    color: #000;
}

.type-go {
    background: #00add8;
    color: #fff;
}

.type-unknown {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-active {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success-color);
}

.status-normal {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning-color);
}

.status-inactive {
    background: rgba(248, 113, 113, 0.2);
    color: var(--error-color);
}

/* Managed Row Highlight */
.managed-row {
    background: rgba(212, 165, 116, 0.05);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

/* Project Detail Modal */
.project-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    gap: 12px;
}

.detail-label {
    flex: 0 0 100px;
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    word-break: break-all;
}

.detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.detail-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
}

.detail-section textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Recent Files List */
.recent-files-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.recent-files-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.recent-files-list li:last-child {
    border-bottom: none;
}

.file-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.file-time {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.recent-files-list .empty {
    color: var(--text-secondary);
    font-style: italic;
}

/* =========================================
   Models Tab - Premium 4-Card Layout
   ========================================= */

.models-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0;
}

.model-card-premium {
    background: rgba(30, 31, 35, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* Model Card Disabled State */
.model-card-premium[data-enabled="false"] {
    opacity: 0.5;
    filter: grayscale(50%);
}

.model-card-premium:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.btn-close-card {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    opacity: 0;
}

.model-card-premium:hover .btn-close-card {
    opacity: 1;
}

.btn-close-card:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ef4444;
}

/* Card Header */
.model-card-premium .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.model-card-premium .icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.model-card-premium .header-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.model-card-premium .header-text .sub-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.model-card-premium .status-indicator {
    margin-left: auto;
}

.model-card-premium .status-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--error-color);
    display: block;
    transition: all 0.3s;
}

/* Themes */
/* Claude Theme */
.claude-theme .icon-box {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.claude-theme:hover {
    box-shadow: 0 8px 32px rgba(156, 163, 175, 0.15);
    border-color: rgba(156, 163, 175, 0.3);
}

.claude-theme .btn-glow {
    background: linear-gradient(90deg, #9ca3af, #b0b7c3);
    box-shadow: 0 0 15px rgba(156, 163, 175, 0.3);
}

/* Gemini Theme */
.gemini-theme .icon-box {
    background: linear-gradient(135deg, #64748b, #475569);
}

.gemini-theme:hover {
    box-shadow: 0 8px 32px rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.3);
}

.gemini-theme .btn-glow {
    background: linear-gradient(90deg, #64748b, #7a8a9e);
    box-shadow: 0 0 15px rgba(100, 116, 139, 0.3);
}

/* Local/CLI Variant - Darker */
.model-card-premium.dark-mode {
    background: rgba(20, 20, 23, 0.8);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.model-card-premium.dark-mode .icon-box {
    filter: brightness(0.8);
}

/* Split Row for Side-by-Side Inputs */
.model-card-premium .split-row {
    display: flex;
    gap: 12px;
}

.model-card-premium .split-row .form-group {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* Inputs */
.model-card-premium .card-body .form-group {
    margin-bottom: 12px;
}

.model-card-premium label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.model-card-premium input,
.model-card-premium select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
    height: 42px;
    line-height: normal;
}

.model-card-premium input:focus,
.model-card-premium select:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    outline: none;
}

/* Buttons */
.model-card-premium .card-footer {
    margin-top: auto;
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-glow {
    flex: 2;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-glow:hover {
    filter: brightness(1.1);
}

.btn-glow:active {
    transform: scale(0.98);
}

.btn-ghost {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 20px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

/* Compact Model Cards & Edit Modal Styles */
.model-card-premium.compact {
    padding: 32px 20px;
    height: auto;
    min-height: 100px;
}

.model-card-premium.compact .card-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.model-card-premium .clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.model-card-premium .clickable:hover {
    opacity: 0.8;
}

.model-card-premium .icon-box.clickable {
    position: relative;
    overflow: visible;
}

.model-card-premium .icon-edit-overlay {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--accent-color);
    color: #1a1a1a;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid #1e1f23;
    opacity: 0;
    transition: all 0.2s;
    z-index: 5;
}

.model-card-premium .icon-box:hover .icon-edit-overlay {
    opacity: 1;
    transform: scale(1.1);
}

.model-info-summary {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Model Filter Bar (Sub-tabs) */
.model-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    width: fit-content;
}

.model-filter-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.model-filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.model-filter-btn.active {
    background: var(--accent-color);
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Model Filter Count Style */
.model-filter-btn span {
    opacity: 0.6;
    margin-left: 4px;
    font-size: 0.9em;
    font-weight: 400;
}

.model-filter-btn.active span {
    opacity: 0.8;
}

/* =========================================
   MCP Gateway Tab Styles
   ========================================= */

.section-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.section-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.gateway-status-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.status-header h3 {
    margin: 0;
}

.status-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
}

.status-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    word-break: break-all;
}

.status-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.status-badge-inline {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge-inline.status-success {
    background-color: rgba(74, 222, 128, 0.2);
    color: var(--success-color);
}

.status-badge-inline.status-error {
    background-color: rgba(248, 113, 113, 0.2);
    color: var(--error-color);
}

.status-badge-inline.status-warning {
    background-color: rgba(251, 191, 36, 0.2);
    color: var(--warning-color);
}

.status-badge-inline.status-unknown {
    background-color: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
}

.settings-form {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}
