/* ============================================================
   Mostaql Go — Redesigned UI
   Palette: slate + teal accent, clean cards, modern typography
   ============================================================ */

/* --- Base --- */
:root {
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #0d9488;
    --accent-light: #ccfbf1;
    --accent-dark: #0f766e;
    --serious: #16a34a;
    --serious-light: #dcfce7;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.07);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
}

body.app-body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
}

body.monitor-body {
    background: var(--surface-muted);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
}

/* --- Dashboard Card --- */
.dashboard-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

/* --- Stat Cards --- */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 6px;
    line-height: 1.1;
}
.stat-label {
    font-size: .95rem;
    color: var(--text-secondary);
}

/* --- Nav Cards --- */
.nav-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all .2s ease;
    text-decoration: none;
    color: var(--text-primary);
    height: 100%;
}
.nav-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    color: var(--accent-dark);
    text-decoration: none;
}
.nav-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--accent);
}
.nav-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.nav-description {
    font-size: .85rem;
    color: var(--text-secondary);
}

/* --- Project Cards --- */
.project-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-right: 4px solid var(--info);
    transition: box-shadow .2s ease;
}
.project-card:hover {
    box-shadow: var(--shadow-md);
}
.project-card.serious {
    border-right-color: var(--serious);
}
.project-card.border-success {
    border-right-color: var(--serious);
}

/* --- Badges --- */
.badge-serious {
    background: var(--serious);
    color: #fff;
}
.badge-normal {
    background: var(--text-muted);
    color: #fff;
}
.badge-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: .85rem;
    padding: 4px 10px;
    border-radius: 20px;
}
.badge-score.high { background: var(--serious-light); color: var(--serious); }
.badge-score.medium { background: #fef3c7; color: #b45309; }
.badge-score.low { background: #fee2e2; color: var(--danger); }

/* --- Score Bar --- */
.score-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.score-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease;
}
.score-bar-fill.high { background: linear-gradient(90deg, #22c55e, #16a34a); }
.score-bar-fill.medium { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.score-bar-fill.low { background: linear-gradient(90deg, #f87171, #ef4444); }
.score-label {
    font-size: .8rem;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
}

/* --- Project Title --- */
.project-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}
.project-title a {
    color: var(--text-primary);
    text-decoration: none;
}
.project-title a:hover {
    color: var(--accent);
}

/* --- Description Truncation --- */
.description-truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.6;
}

/* --- Monitor Tabs --- */
.monitor-tabs {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 6px;
    border: 1px solid var(--border);
}
.monitor-tabs .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all .2s ease;
}
.monitor-tabs .nav-link.active,
.monitor-tabs .nav-link:hover {
    background: var(--accent);
    color: #fff;
}

/* --- Project Details --- */
.project-details-container {
    max-width: 780px;
    margin: 40px auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid var(--border);
}
.project-details-container h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
}
.project-details-container .label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: 1.2rem;
    margin-bottom: .3rem;
}
.project-details-container .value {
    margin-bottom: .8rem;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: .95rem;
}

/* --- Score Widget in Details --- */
.score-widget {
    background: var(--surface-muted);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 1rem 0;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}
.score-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.score-circle.high { background: var(--serious); }
.score-circle.medium { background: var(--warning); }
.score-circle.low { background: var(--danger); }
.score-info h4 {
    margin: 0 0 2px 0;
    font-size: .95rem;
    font-weight: 600;
}
.score-info span {
    font-size: .85rem;
    color: var(--text-secondary);
}

/* --- Back Link --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
}
.back-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* --- Buttons --- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all .2s ease;
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}
.btn-success {
    background: var(--serious);
    border-color: var(--serious);
}
.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* --- Form Controls --- */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px 12px;
    transition: border-color .2s ease;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}

/* --- Pagination --- */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* --- Utilities --- */
.text-accent { color: var(--accent); }
.text-serious { color: var(--serious); }
.text-muted-custom { color: var(--text-secondary); }

/* --- Mini Stats (Projects Page) --- */
.mini-stat {
    background: var(--surface-muted);
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
    border: 1px solid var(--border);
}
.mini-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.mini-stat-value-sm {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}
.mini-stat-label {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.mini-stat-inline {
    display: flex;
    align-items: center;
    text-align: start;
}
