/* web/static/css/layout.css */
/* Shared header + footer styles for all Mtafiti pages */

:root {
    --brand-primary: #1a237e;
    --brand-primary-light: #0d47a1;
    --brand-accent: #1976d2;
    --bg-page: #f5f7fa;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --border-soft: #e8ecf1;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ===== Header ===== */
.site-header {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: white;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .site-title { color: #fff; }
.site-header .site-tagline { color: rgba(255,255,255,0.65); }
.site-header .profile-caret { color: rgba(255,255,255,0.7); }
.site-header .profile-trigger {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
    color: #fff;
}
.site-header .profile-trigger:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.25);
}
.site-header .global-search {
    background: rgba(255,255,255,0.95);
    border-color: rgba(255,255,255,0.2);
}

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

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}

.site-logo { font-size: 28px; line-height: 1; }

.site-brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.site-title { font-size: 20px; font-weight: 700; color: white; }
.site-tagline { font-size: 12px; opacity: 0.8; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }

.site-nav-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.site-nav-link:hover { background: rgba(255, 255, 255, 0.15); }
.site-nav-link.active { background: rgba(255, 255, 255, 0.2); font-weight: 600; }

.site-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.site-header-right .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.site-header-right .plan-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
}
.site-header-right .plan-badge.free { background: #e8f5e9; color: #2e7d32; }
.site-header-right .plan-badge.basic { background: #fff3e0; color: #e65100; }
.site-header-right .plan-badge.pro { background: #e3f2fd; color: #0d47a1; }
.site-header-right .plan-badge.pro_plus { background: #f3e5f5; color: #6a1b9a; }

.site-header-right .btn-small {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
}
.site-header-right .btn-small:hover { background: rgba(255, 255, 255, 0.25); }

/* ===== Footer ===== */
.site-footer {
    background: #0d1733;
    color: rgba(255, 255, 255, 0.7);
    padding: 32px 25px 16px;
    margin-top: 40px;
    font-size: 13px;
}

.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 24px;
}

.site-footer-col { display: flex; flex-direction: column; gap: 6px; }
.site-footer-col strong { color: white; font-size: 13px; margin-bottom: 4px; }
.site-footer-col p { font-size: 12px; line-height: 1.6; }
.site-footer-col a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
}
.site-footer-col a:hover { color: white; text-decoration: underline; }

.site-footer-bottom {
    max-width: 1100px;
    margin: 24px auto 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .site-header { padding: 10px 15px; }
    .site-nav { order: 3; width: 100%; justify-content: center; }
    .site-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .site-footer-inner { grid-template-columns: 1fr; }
}

/* Dismissal/Trial/Guest Banner */
.trial-banner {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    z-index: 999;
}

.trial-banner-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trial-banner-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.trial-banner-message {
    flex: 1;
    line-height: 1.4;
}

.trial-banner-cta {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 5px;
    background: white;
    color: #1a237e;
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.15s;
}

.trial-banner-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.trial-banner-dismiss {
    background: none;
    border: none;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px 8px;
}

.trial-banner-dismiss:hover {
    opacity: 1;
}

/* Severity styles */
.trial-banner-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #0d47a1;
}
.trial-banner-info .trial-banner-cta {
    background: #0d47a1;
    color: white;
}

.trial-banner-warning {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #e65100;
}
.trial-banner-warning .trial-banner-cta {
    background: #e65100;
    color: white;
}

.trial-banner-urgent {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #b71c1c;
}
.trial-banner-urgent .trial-banner-cta {
    background: #b71c1c;
    color: white;
}

.trial-banner-expired {
    background: linear-gradient(135deg, #37474f, #263238);
    color: white;
}
.trial-banner-expired .trial-banner-cta {
    background: #ffffff;
    color: #263238;
    font-weight: 700;
}