/* ============================================
   DASHBOARD PROFESSIONAL STYLES - DTE SERVICE
   ============================================ */

:root {
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --secondary-color: #6b7280;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* ============================================
   STATISTICS CARDS
   ============================================ */

.stats-container {
    padding: 1.5rem 0;
    animation: fadeIn 0.5s ease-in;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.stat-card:hover::before {
    transform: translateX(100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-color);
}

.stat-card-active {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.stat-card-primary {
    --accent-color: var(--primary-color);
}

.stat-card-success {
    --accent-color: var(--success-color);
}

.stat-card-warning {
    --accent-color: var(--warning-color);
}

.stat-card-danger {
    --accent-color: var(--danger-color);
}

.stat-card-info {
    --accent-color: var(--info-color);
}

.stat-card-secondary {
    --accent-color: var(--secondary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

.stat-card-success .stat-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.stat-card-warning .stat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.stat-card-danger .stat-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.stat-card-info .stat-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info-color);
}

.stat-card-secondary .stat-icon {
    background: rgba(107, 114, 128, 0.15);
    color: var(--secondary-color);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   PULSE ANIMATION
   ============================================ */

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    display: inline-block;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

/* ============================================
   PROCESS RUNNING INDICATOR
   ============================================ */

.process-running {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--warning-color);
}

/* ============================================
   DASHBOARD HEADER IMPROVEMENTS
   ============================================ */

.dashboard-header {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(30, 41, 59, 0.95) 100%);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: slideInDown 0.5s ease-out;
}

.dashboard-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-badge-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.build-version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   IMPROVED CARDS AND CONTAINERS
   ============================================ */

.dashboard-controls,
.dashboard-grids,
.dashboard-logs {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.dashboard-controls {
    animation-delay: 0.1s;
}

.dashboard-grids {
    animation-delay: 0.2s;
}

.dashboard-logs {
    animation-delay: 0.3s;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* ============================================
   LOADING STATE
   ============================================ */

.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25em;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border.text-warning {
    border-color: currentColor;
    border-right-color: transparent;
}

/* ============================================
   LOG VIEWER ENHANCEMENTS
   ============================================ */

.log-entry {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.log-entry:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.log-entry-fade-in {
    animation: logFadeIn 0.3s ease-out;
}

@keyframes logFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-timestamp {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    font-weight: 500;
}

.log-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.log-level-folio {
    color: var(--info-color);
    font-weight: 500;
}

.log-level-info {
    color: var(--primary-color);
}

.log-level-result {
    color: var(--success-color);
    font-weight: 500;
}

.log-level-error {
    color: var(--danger-color);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.log-level-processing {
    color: var(--warning-color);
    font-weight: 500;
}

.log-level-warning {
    color: var(--warning-color);
}

.log-level-success {
    color: var(--text-primary);
}

.log-console {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.log-console::-webkit-scrollbar {
    width: 8px;
}

.log-console::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 4px;
}

.log-console::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.log-console::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-action-edit {
    color: var(--primary-color) !important;
}

.btn-action-edit:hover {
    color: #60a5fa !important;
}

.btn-action-delete {
    color: var(--danger-color) !important;
}

.btn-action-delete:hover {
    color: #f87171 !important;
}

.btn-action-test {
    color: var(--success-color) !important;
}

.btn-action-test:hover {
    color: #34d399 !important;
}

.btn-action-play {
    color: var(--success-color) !important;
}

.btn-action-play:hover {
    color: #34d399 !important;
}

.btn-action-stop {
    color: var(--danger-color) !important;
}

.btn-action-stop:hover {
    color: #f87171 !important;
}

.btn-action-refresh {
    color: var(--info-color) !important;
}

.btn-action-refresh:hover {
    color: #22d3ee !important;
}

/* ============================================
   PROCESS STATUS BADGES
   ============================================ */

.process-status-container {
    display: flex;
    align-items: center;
}

.process-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.process-status-badge.running {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.process-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.process-status-badge.inactive {
    background: rgba(107, 114, 128, 0.15);
    color: var(--secondary-color);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.process-status-badge .status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.process-status-badge.running .status-indicator {
    background: var(--warning-color);
    animation: pulse-indicator 1.5s ease-in-out infinite;
}

.process-status-badge.active .status-indicator {
    background: var(--success-color);
}

.process-status-badge.inactive .status-indicator {
    background: var(--secondary-color);
}

@keyframes pulse-indicator {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ============================================
   CONNECTION STATUS
   ============================================ */

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   GRID ENHANCEMENTS
   ============================================ */

.grid-justclaude,
.grid-justclaude2 {
    border-radius: 8px;
    overflow: hidden;
}

.e-grid .e-headercell {
    background: rgba(30, 41, 59, 0.95) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    border-color: var(--border-color) !important;
}

.e-grid .e-row {
    transition: background-color 0.2s ease;
}

.e-grid .e-row:hover {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.e-grid .e-altrow {
    background-color: rgba(15, 23, 42, 0.3) !important;
}

/* ============================================
   DARK MODE ENHANCEMENTS
   ============================================ */

body {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.card, .panel, .grid-container {
    background: var(--bg-card);
    border-color: var(--border-color);
}
