/**
 * AI Training Page - Multi-Model Styles
 */

:root {
    --bg-dark: #0a0a0f;
    --bg-panel: #12121a;
    --bg-card: #1a1a24;
    --border-color: #2a2a3a;
    --text-primary: #ffffff;
    --text-secondary: #888899;
    --accent-cyan: #00ffff;
    --accent-orange: #ff6a00;
    --accent-green: #00ff88;
    --accent-red: #ff4444;
    --accent-purple: #aa66ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow: hidden;
}

#training-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* TOP BAR */
#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(180deg, rgba(0,255,255,0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
}

.bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--accent-cyan);
}

.back-arrow::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 8px solid currentColor;
}

.header-logo {
    height: 32px;
    width: auto;
    margin-right: 12px;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.5));
}

.title {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(0,255,255,0.3);
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-nav-links .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s;
    cursor: pointer;
}

.admin-nav-links .nav-link:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.admin-nav-links .nav-link.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
}

.status-indicator.online .status-dot { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.status-indicator.training .status-dot { background: var(--accent-orange); box-shadow: 0 0 8px var(--accent-orange); animation: pulse 1s infinite; }
.status-indicator.offline .status-dot { background: var(--accent-red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* MAIN CONTENT */
#main-content {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 15px;
    padding: 15px;
    flex: 1;
    overflow: hidden;
}

/* PANELS */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-icon {
    font-size: 16px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* MODELS PANEL */
.btn-add-model {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--accent-cyan);
    background: transparent;
    color: var(--accent-cyan);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-model:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
}

#models-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-models {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px 15px;
    font-size: 13px;
}

.model-card {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.model-card:hover {
    border-color: var(--accent-cyan);
    background: rgba(0,255,255,0.05);
}

.model-card.selected {
    border-color: var(--accent-cyan);
    background: rgba(0,255,255,0.1);
    box-shadow: 0 0 15px rgba(0,255,255,0.2);
}

.model-card.training {
    border-color: var(--accent-orange);
}

.model-card.training .model-card-status {
    color: var(--accent-orange);
}

.model-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.model-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.model-card-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
}

.model-card-status.training {
    background: rgba(255,106,0,0.2);
    color: var(--accent-orange);
}

.model-card-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.model-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.model-card-stats strong {
    color: var(--text-primary);
}

/* Global Stats Section */
.global-stats-section {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.global-stats-section h3 {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mini-stat {
    text-align: center;
    padding: 8px 4px;
    background: var(--bg-card);
    border-radius: 6px;
}

.mini-stat-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.mini-stat-label {
    display: block;
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* CENTER PANEL */
#center-panel {
    overflow: hidden;
}

#center-panel .panel-content {
    padding: 0;
}

.live-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,0,0,0.2);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #ff4444;
    animation: pulse 1s infinite;
}

.live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4444;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h2 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Model Details */
#model-details {
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#model-details.training-active {
    /* When training is active, optimize for live view */
}

#model-details.training-active .model-config-display {
    display: none; /* Hide config during training to save space */
}

#model-details.training-active .model-stats-grid {
    margin-bottom: 15px;
}

.model-header {
    margin-bottom: 20px;
}

.model-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.model-name-row h2 {
    font-size: 22px;
    color: var(--text-primary);
}

.model-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
}

.model-status.training {
    background: rgba(255,106,0,0.2);
    color: var(--accent-orange);
    animation: pulse 1s infinite;
}

.model-description {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Model Actions */
.model-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-danger-outline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #0088aa);
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,255,255,0.3);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #aa2222);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255,68,68,0.3);
}

.btn-danger-outline {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.btn-danger-outline:hover {
    background: rgba(255,68,68,0.1);
}

.btn-clone {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
}

.btn-clone:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(33,150,243,0.3);
}

.btn-icon {
    font-size: 12px;
}

/* Stats Grid */
.model-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Config Display */
.model-config-display {
    margin-bottom: 25px;
}

.model-config-display h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 12px;
}

.config-item-label {
    color: var(--text-secondary);
}

.config-item-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Live Canvas */
#live-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#live-canvas-container h3,
#agents-section h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 400px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.canvas-wrapper canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.view-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.view-controls button {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.view-controls button:hover {
    background: rgba(255,255,255,0.1);
}

.zoom-level {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Agents List */
#agents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.agent-card {
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 3px solid var(--accent-cyan);
}

.agent-card.dead {
    opacity: 0.5;
    border-left-color: var(--accent-red);
}

.agent-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.agent-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.agent-stats strong {
    color: var(--text-primary);
}

/* REWARD TRACKING */
.agent-rewards-tracking {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 10px;
}

.rewards-row, .penalties-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.reward-item {
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 9px;
}

.reward-item.positive {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.reward-item.negative {
    background: rgba(255, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

/* INFO PANEL */
.info-section {
    margin-bottom: 20px;
}

.info-section h3 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.info-box {
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 12px;
}

.info-box p {
    margin-bottom: 6px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.no-history {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.history-item {
    padding: 10px;
    background: var(--bg-card);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 11px;
}

.history-item .date {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.history-item .stats {
    display: flex;
    gap: 12px;
    color: var(--text-secondary);
}

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

.help-text p {
    margin-bottom: 8px;
}

/* DIALOG */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 500px;
    max-width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dialog-header h2 {
    font-size: 16px;
}

.dialog-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

.dialog-close:hover {
    background: rgba(255,68,68,0.3);
}

.dialog-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.form-section-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 20px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Responsive */
@media (max-width: 1200px) {
    #main-content {
        grid-template-columns: 240px 1fr 220px;
    }
}

@media (max-width: 900px) {
    #main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    #models-panel {
        max-height: 200px;
    }
}

/* ============================================ */
/* AUTO AI TOGGLE SECTION                       */
/* ============================================ */

.autoai-toggle-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Reward Configuration Section */
.reward-config-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.reward-config-section .form-section-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.reward-config-section .form-section-title:hover {
    color: var(--accent-orange);
}

.collapse-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.collapse-arrow.expanded {
    transform: rotate(180deg);
}

.reward-config-container {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.reward-config-container::-webkit-scrollbar {
    width: 8px;
}

.reward-config-container::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 4px;
}

.reward-config-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.reward-config-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

.reward-category {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 255, 255, 0.02);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 10px;
}

.reward-category-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.reward-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.reward-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reward-item label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reward-item input {
    width: 100%;
    padding: 6px 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    text-align: right;
}

.reward-item input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.reward-item input::-webkit-inner-spin-button,
.reward-item input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.reward-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.autoai-toggle-section .form-section-title {
    color: #a855f7;
    margin-bottom: 15px;
}

.autoai-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 10px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.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: #333;
    transition: 0.3s;
    border-radius: 26px;
}

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

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(168, 85, 247, 0.5);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
}

.autoai-toggle-info {
    flex: 1;
}

.toggle-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toggle-description {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.autoai-info-box {
    margin-top: 12px;
    padding: 12px 15px;
    background: rgba(168, 85, 247, 0.05);
    border-radius: 8px;
    border-left: 3px solid #a855f7;
}

.autoai-info-box p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 6px 0;
}

.autoai-info-box p:first-child {
    margin-top: 0;
}

.autoai-info-box p:last-child {
    margin-bottom: 0;
}

/* AutoAI Status in Model Details */
.autoai-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #a855f7;
    margin-left: 10px;
}

.autoai-status-badge.active {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.4);
    color: var(--accent-green);
}

.autoai-status-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.autoai-status-badge.active .dot {
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* AutoAI Controls in Model Actions */
.autoai-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(168, 85, 247, 0.3);
}

.btn-autoai {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 6px;
    color: #a855f7;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-autoai:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: #a855f7;
}

.btn-autoai:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-autoai .icon {
    font-size: 14px;
}

/* AI-Guided Model Creation Button */
.btn-add-model.btn-ai-guided {
    margin-left: 0;
    margin-right: 8px;
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.5);
    color: #a855f7;
}

.btn-add-model.btn-ai-guided:hover {
    background: #a855f7;
    color: var(--bg-dark);
}

/* AI-Guided Dialog */
.ai-guided-dialog {
    max-width: 480px;
}

.ai-guided-header {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(0, 255, 255, 0.1) 100%);
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
}

.ai-guided-header h2 {
    background: linear-gradient(90deg, #a855f7, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-guided-info {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.ai-guided-info p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.ai-guided-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    margin-top: 16px;
}

.ai-guided-status span {
    color: #a855f7;
    font-size: 13px;
}

.ai-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-ai-create {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(0, 255, 255, 0.2) 100%);
    border-color: #a855f7;
}

.btn-ai-create:hover {
    background: linear-gradient(135deg, #a855f7 0%, rgba(0, 255, 255, 0.4) 100%);
}

.btn-ai-create:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea#ai-guided-goal {
    resize: vertical;
    min-height: 80px;
}

/* Parameter Hints */
.param-hint {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.3;
    opacity: 0.8;
}

/* Wave Hint Box */
.wave-hint-box {
    display: block;
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.wave-hint-box strong {
    color: var(--primary);
    font-size: 11px;
}

.form-section-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin: -8px 0 12px 0;
    opacity: 0.7;
}

/* Full width form group */
.form-group.full-width {
    width: 100%;
}

/* Toggle inline label */
.toggle-label-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-label-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

.toggle-label-inline .toggle-text {
    font-size: 13px;
    color: var(--text-primary);
}

/* Make dialog scrollable for more content */
.dialog-content {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* Scrollbar styling for dialog */
.dialog-content::-webkit-scrollbar {
    width: 6px;
}

.dialog-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.dialog-content::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 3px;
}

.dialog-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-orange);
}

/* ============================================
   MOBILE RESPONSIVE - COMPREHENSIVE
   ============================================ */

/* Tablet and below */
@media (max-width: 1024px) {
    /* Top bar responsive */
    #top-bar {
        height: auto;
        min-height: 60px;
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .bar-left, .bar-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Admin nav links - scrollable on mobile */
    .admin-nav-links {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0;
        max-width: 100%;
    }

    .admin-nav-links .nav-link {
        width: 36px;
        height: 36px;
        font-size: 16px;
        flex-shrink: 0;
    }

    /* Main content - panels stackable */
    #main-content {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow-y: auto;
        gap: 0;
    }

    #models-panel, #center-panel, #info-panel {
        width: 100% !important;
        min-width: 100%;
        max-height: none;
        height: auto;
        border-radius: 0;
    }

    #models-panel {
        height: auto;
        max-height: 250px;
        border-bottom: 1px solid var(--border-color);
    }

    #center-panel {
        min-height: 500px;
        flex: 1;
    }

    #info-panel {
        max-height: 300px;
    }

    /* Panel content */
    .panel-content {
        padding: 12px;
    }

    /* Stats grid */
    .model-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .mini-stat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    /* Canvas */
    .canvas-wrapper {
        min-height: 300px;
    }

    /* Buttons - touch friendly */
    .btn-primary, .btn-secondary, .btn-danger, .btn-danger-outline, .btn-clone {
        font-size: 13px;
        padding: 12px 16px;
        min-height: 44px;
    }

    /* Dialog - fullscreen on mobile */
    .dialog {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .dialog-content {
        max-height: calc(100vh - 140px);
        padding: 16px;
    }

    /* Form rows */
    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .form-group {
        width: 100%;
    }

    /* Model tabs - scrollable */
    .model-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 2px;
        padding-bottom: 8px;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Reward grid - 2 columns on tablet */
    .reward-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .reward-item input {
        font-size: 14px;
        padding: 10px 8px;
    }

    /* Settings grid */
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    #training-container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    /* Top bar more compact */
    #top-bar {
        padding: 8px 12px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .title {
        font-size: 14px;
    }

    .header-logo {
        height: 24px;
    }

    /* Hide less important nav links */
    .admin-nav-links .nav-link {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    /* Status indicator compact */
    .status-indicator {
        padding: 4px 10px;
        font-size: 10px;
    }

    /* Panel headers smaller */
    .panel-header {
        font-size: 12px;
        padding: 10px 12px;
    }

    .panel-icon {
        font-size: 14px;
    }

    /* Models panel - horizontal scroll for cards */
    #models-panel {
        max-height: 200px;
    }

    #models-list {
        gap: 6px;
    }

    /* Model cards */
    .model-card {
        padding: 10px;
    }

    .model-card-name {
        font-size: 13px;
    }

    .model-card-stats {
        font-size: 10px;
        gap: 8px;
    }

    /* Stats - 2 columns */
    .model-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 9px;
    }

    .mini-stat-value {
        font-size: 16px;
    }

    .mini-stat-label {
        font-size: 8px;
    }

    /* Form elements touch-optimized - 16px prevents zoom on iOS */
    input[type="text"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
        border-radius: 8px;
    }

    button {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Config display */
    .config-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .config-item {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Agent cards - single column */
    #agents-list {
        grid-template-columns: 1fr;
    }

    .agent-card {
        padding: 10px;
    }

    .agent-name {
        font-size: 12px;
    }

    .agent-stats {
        font-size: 10px;
        gap: 6px;
    }

    /* View controls - touch optimized */
    .view-controls {
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .view-controls button {
        font-size: 14px;
        padding: 10px 14px;
        min-height: 44px;
        min-width: 44px;
    }

    /* Empty state */
    .empty-state {
        padding: 24px 16px;
    }

    .empty-icon {
        font-size: 48px;
    }

    .empty-state h2 {
        font-size: 16px;
    }

    .empty-state p {
        font-size: 12px;
    }

    /* Live badge */
    .live-badge {
        font-size: 9px;
        padding: 4px 8px;
    }

    /* History */
    .history-item {
        padding: 8px;
    }

    .history-item .date {
        font-size: 10px;
    }

    .history-item .stats {
        font-size: 10px;
    }

    /* Model actions - wrap on mobile */
    .model-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .model-actions button {
        flex: 1 1 45%;
        min-width: 120px;
    }

    /* Tabs - smaller */
    .tab-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .tab-icon {
        font-size: 12px;
    }

    /* Reward grid - single column on mobile */
    .reward-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .reward-category {
        padding: 12px;
        margin-bottom: 12px;
    }

    .reward-category-title {
        font-size: 12px;
    }

    .reward-item label {
        font-size: 10px;
    }

    .reward-item input {
        padding: 8px 6px;
        font-size: 14px;
    }

    /* Settings */
    .settings-section {
        padding: 14px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-group input {
        font-size: 16px;
    }

    /* AI Suggest section */
    .ai-suggest-card {
        padding: 16px;
    }

    .ai-suggest-card h4 {
        font-size: 14px;
    }

    /* AutoAI toggle */
    .autoai-toggle-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .toggle-switch {
        align-self: flex-start;
    }
}

/* Small phones */
@media (max-width: 480px) {
    /* Top bar minimal */
    #top-bar {
        padding: 6px 10px;
    }

    .title {
        display: none;
    }

    .btn-back {
        padding: 8px 12px;
    }

    .btn-back span {
        display: none;
    }

    /* Panel headers minimal */
    .panel-header {
        font-size: 11px;
        padding: 8px 10px;
    }

    .btn-add-model {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Stats grid - 2 columns */
    .model-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .stat-card {
        padding: 8px;
    }

    .stat-value {
        font-size: 16px;
    }

    .stat-label {
        font-size: 8px;
    }

    .mini-stat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .mini-stat {
        padding: 6px 4px;
    }

    .mini-stat-value {
        font-size: 14px;
    }

    .mini-stat-label {
        font-size: 7px;
    }

    /* Buttons - full width */
    .model-actions {
        flex-direction: column;
        gap: 6px;
    }

    .model-actions button {
        width: 100%;
        flex: none;
    }

    /* Canvas smaller */
    .canvas-wrapper {
        min-height: 250px;
    }

    /* Form hints smaller */
    .param-hint {
        font-size: 9px;
    }

    .form-section-hint {
        font-size: 10px;
    }

    .form-section-title {
        font-size: 12px;
    }

    /* Dialog */
    .dialog-header {
        padding: 12px 14px;
    }

    .dialog-header h2 {
        font-size: 14px;
    }

    .dialog-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .dialog-actions {
        flex-direction: column;
        gap: 8px;
        padding: 12px 14px;
    }

    .dialog-actions button {
        width: 100%;
    }

    /* Tabs - icons only */
    .tab-btn {
        padding: 10px;
        gap: 0;
    }

    .tab-btn span:not(.tab-icon) {
        display: none;
    }

    .tab-icon {
        font-size: 16px;
    }

    /* Reward config even more compact */
    .reward-grid {
        grid-template-columns: 1fr;
    }

    .reward-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .reward-item label {
        flex: 1;
        margin-bottom: 0;
    }

    .reward-item input {
        width: 80px;
        flex-shrink: 0;
    }

    /* Info panel - collapsible style */
    #info-panel {
        max-height: 200px;
    }

    .info-box {
        padding: 10px;
    }

    .info-box p {
        font-size: 11px;
    }

    /* History compact */
    .config-history-item {
        padding: 10px;
    }

    .history-change {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* iPhone SE and very small screens */
@media (max-width: 375px) {
    .model-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-value {
        font-size: 14px;
    }

    .reward-grid {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        padding: 8px;
    }

    .tab-icon {
        font-size: 14px;
    }
}

/* ============================================
   MODAL ALERT SYSTEM
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: linear-gradient(145deg, var(--bg-panel), var(--bg-dark));
    border: 2px solid var(--accent-cyan);
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
}

.modal-container.modal-confirm {
    border-color: var(--accent-orange);
    box-shadow: 0 0 40px rgba(255, 106, 0, 0.3);
}

@keyframes modalSlideIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.modal-icon-success { color: var(--accent-green); }
.modal-icon-error { color: var(--accent-red); }
.modal-icon-warning { color: var(--accent-orange); }
.modal-icon-info { color: var(--accent-cyan); }

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 100px;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #0088aa);
    color: var(--bg-dark);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.4);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #aa2222);
    color: white;
}

.modal-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 68, 68, 0.4);
}

/* ============================================
   TAB SYSTEM
   ============================================ */

.model-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 0;
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    background: rgba(0, 255, 255, 0.1);
}

.tab-icon {
    font-size: 14px;
}

.tab-pane {
    display: none;
    animation: tabFadeIn 0.2s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SETTINGS TAB
   ============================================ */

.settings-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.settings-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.settings-group input[type="text"],
.settings-group input[type="number"] {
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.settings-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
}

.settings-hint {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.settings-checkbox {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-cyan);
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   REWARDS TAB
   ============================================ */

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

.reward-tab-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.reward-tab-actions {
    display: flex;
    gap: 10px;
}

.reward-tab-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* ============================================
   HISTORY TAB
   ============================================ */

.history-tab-header {
    margin-bottom: 20px;
}

.history-tab-header h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.history-tab-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.config-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: 10px;
}

.config-history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid var(--accent-cyan);
}

.config-history-item.reward-change {
    border-left-color: var(--accent-orange);
}

.config-history-item.settings-change {
    border-left-color: var(--accent-green);
}

.config-history-item.ai-suggested {
    border-left-color: var(--accent-purple);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.history-item-type {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.history-item-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.history-item-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-change {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 11px;
}

.history-change-key {
    color: var(--text-secondary);
}

.history-change-old {
    color: var(--accent-red);
    text-decoration: line-through;
}

.history-change-arrow {
    color: var(--text-secondary);
}

.history-change-new {
    color: var(--accent-green);
    font-weight: 600;
}

/* ============================================
   AI SUGGEST TAB
   ============================================ */

.ai-suggest-header {
    margin-bottom: 25px;
}

.ai-suggest-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-suggest-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.ai-suggest-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-suggest-card {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.1), rgba(0, 255, 255, 0.05));
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 25px;
}

.ai-suggest-card h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.ai-suggest-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.ai-suggest-loading {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 10px;
}

.ai-suggest-loading span {
    color: #a855f7;
    font-size: 14px;
}

.ai-suggest-result {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.ai-suggest-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.ai-suggest-result-header h4 {
    font-size: 15px;
    color: var(--accent-cyan);
    margin: 0;
}

.ai-timestamp {
    font-size: 11px;
    color: var(--text-secondary);
}

.ai-analysis-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.ai-suggested-params {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    padding: 15px;
}

.ai-suggested-params h5 {
    font-size: 13px;
    color: var(--accent-green);
    margin-bottom: 12px;
}

.suggested-params-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.suggested-param {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 12px;
}

.suggested-param-name {
    color: var(--text-secondary);
    flex: 1;
}

.suggested-param-old {
    color: var(--text-secondary);
    opacity: 0.7;
}

.suggested-param-arrow {
    color: var(--accent-cyan);
}

.suggested-param-new {
    color: var(--accent-green);
    font-weight: 600;
}

.ai-suggest-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button, .btn-primary, .btn-secondary, .btn-danger {
        min-height: 48px;
        min-width: 48px;
    }

    .model-card {
        min-height: 80px;
        cursor: pointer;
    }

    /* Better tap feedback */
    * {
        -webkit-tap-highlight-color: rgba(0, 243, 255, 0.2);
    }

    /* Scroll snapping */
    #models-list {
        scroll-snap-type: y mandatory;
    }

    .model-card {
        scroll-snap-align: start;
    }
}

/* Landscape on mobile */
@media (max-width: 1024px) and (orientation: landscape) {
    #top-bar {
        min-height: 50px;
    }

    #main-content {
        flex-direction: row;
    }

    #models-panel {
        width: 30% !important;
        height: 100%;
        max-height: none;
    }

    #center-panel {
        width: 45% !important;
    }

    #info-panel {
        width: 25% !important;
    }

    #training-canvas {
        max-height: 400px;
    }
}
