/* ===================================================================
   GA4 Behavioral Red Flags Diagnostic - Branded Styles
   Colors: #70215a (plum), #cd1d87 (magenta), #fa9d42 (orange),
           #ffa7ec (pink), #7b5bfb (purple), #1a1a1a (black), #3b3b3b (grey)
   Fonts: Raleway
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

:root {
    --bg: #1a1a1a;
    --bg-card: #242424;
    --bg-hover: #2e2e2e;
    --text: #f0e8ed;
    --text-muted: #a89aa3;
    --plum: #70215a;
    --magenta: #cd1d87;
    --orange: #fa9d42;
    --pink: #ffa7ec;
    --purple: #7b5bfb;
    --black: #1a1a1a;
    --grey: #3b3b3b;
    --accent: #cd1d87;
    --accent-glow: rgba(205, 29, 135, 0.3);
    --green: #2d6a4f;
    --green-light: #52b788;
    --yellow: #fa9d42;
    --border: #3b3b3b;
    --radius: 8px;
    --radius-lg: 12px;
    --font-title: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.btn, .logo, .hero-badge, .feature-icon,
.severity-badge, .severity-pill, .flag-count,
.quick-win-label, .wtf-category, .flag-category h3,
.nav-link, .property-name, .property-id {
    font-family: var(--font-title);
}

a { color: var(--magenta); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--pink); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-family: var(--font-title);
}
.btn-primary {
    background: linear-gradient(135deg, var(--magenta), var(--plum));
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--pink), var(--magenta));
    text-decoration: none;
    box-shadow: 0 0 25px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--magenta);
    color: var(--magenta);
}
.btn-outline:hover {
    background: var(--magenta);
    color: #fff;
    text-decoration: none;
}
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ===================================================================
   Landing Page
   =================================================================== */

.landing { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-title);
}
.logo-accent { color: var(--magenta); }

.hero {
    text-align: center;
    padding: 80px 0 60px;
}
.hero-badge {
    display: inline-block;
    padding: 6px 20px;
    background: linear-gradient(135deg, var(--magenta), var(--purple));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 20px;
    margin-bottom: 24px;
}
.hero h1 {
    font-family: var(--font-title);
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    color: #fff;
}
.hero-sub {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
}
.hero-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Features */
.what-you-get {
    padding: 60px 0;
    border-top: 1px solid var(--border);
}
.what-you-get h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #fff;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: border-color 0.3s;
}
.feature-card:hover {
    border-color: var(--purple);
}
.feature-icon {
    font-size: 2rem;
    font-weight: 900;
    color: var(--magenta);
    margin-bottom: 12px;
}
.grade-icon { font-size: 1.5rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: #fff; }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); }

/* Red flags preview */
.red-flags-preview {
    padding: 60px 0;
    border-top: 1px solid var(--border);
}
.red-flags-preview h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #fff;
}
.flags-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.flag-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.flag-category h3 { font-size: 0.9rem; color: var(--magenta); margin-bottom: 8px; letter-spacing: 1px; text-transform: uppercase; }
.flag-category ul { list-style: none; }
.flag-category li {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}
.flag-category li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--purple);
}

.landing-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===================================================================
   App / Report Layout
   =================================================================== */

.app-container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--text-muted); font-size: 0.85rem; }
.nav-link:hover { color: var(--pink); }

/* Property Selection */
.select-property { padding: 60px 0; }
.select-property h1 { font-size: 1.8rem; margin-bottom: 8px; color: #fff; }
.subtitle { color: var(--text-muted); margin-bottom: 32px; }

.property-list { display: flex; flex-direction: column; gap: 12px; }
.property-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: all 0.3s;
    color: var(--text);
    text-decoration: none;
}
.property-card:hover {
    border-color: var(--magenta);
    box-shadow: 0 0 15px var(--accent-glow);
    text-decoration: none;
}
.property-name { font-weight: 700; font-size: 1.1rem; flex: 1; }
.property-account { color: var(--text-muted); font-size: 0.9rem; margin: 0 24px; }
.property-id { color: var(--text-muted); font-size: 0.8rem; font-family: monospace; }
.property-arrow { font-size: 1.5rem; color: var(--magenta); margin-left: 16px; }

.empty-state { text-align: center; padding: 60px 0; }
.empty-state h2 { margin-bottom: 12px; color: #fff; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ===================================================================
   Report
   =================================================================== */

.report { padding-bottom: 60px; }

/* Grade Hero */
.grade-hero {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 48px 0;
    border-bottom: 1px solid var(--border);
}
.grade-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 4px solid;
}
.grade-letter { font-size: 4rem; font-weight: 900; }
.grade-a { border-color: var(--green); color: var(--green); }
.grade-b { border-color: var(--green-light); color: var(--green-light); }
.grade-c { border-color: var(--orange); color: var(--orange); }
.grade-d { border-color: var(--purple); color: var(--purple); }
.grade-f { border-color: var(--magenta); color: var(--magenta); }

.grade-info h1 { font-size: 1.8rem; margin-bottom: 8px; color: #fff; }
.grade-summary { margin-bottom: 16px; }

.severity-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.severity-critical { background: var(--magenta); color: #fff; }
.severity-warning { background: var(--orange); color: #000; }
.severity-healthy { background: var(--green); color: #fff; }

.health-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.health-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--magenta), var(--orange), var(--green));
    transition: width 1s ease;
}
.health-label { font-size: 0.85rem; color: var(--text-muted); }

/* WTF Section */
.wtf-section { padding: 40px 0; border-bottom: 1px solid var(--border); }
.wtf-section h2 { font-size: 1.3rem; margin-bottom: 20px; color: #fff; }
.wtf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.wtf-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border-left: 4px solid;
}
.severity-border-critical { border-left-color: var(--magenta); }
.severity-border-high { border-left-color: var(--purple); }
.severity-border-medium { border-left-color: var(--orange); }

.wtf-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.severity-dot { width: 8px; height: 8px; border-radius: 50%; }
.severity-dot-critical { background: var(--magenta); }
.severity-dot-high { background: var(--purple); }
.severity-dot-medium { background: var(--orange); }
.wtf-category { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.wtf-card h3 { font-size: 1.1rem; color: #fff; margin-bottom: 8px; }
.wtf-metric { font-size: 0.9rem; color: var(--magenta); font-weight: 700; margin-bottom: 8px; font-family: var(--font-title); }
.wtf-insight { font-size: 0.9rem; color: var(--text-muted); font-style: italic; margin-bottom: 8px; }
.wtf-recommendation { font-size: 0.85rem; color: var(--text); }

/* Quick Win */
.quick-win-section { padding: 40px 0; border-bottom: 1px solid var(--border); }
.quick-win-section h2 { font-size: 1.3rem; margin-bottom: 16px; color: #fff; }
.quick-win-card {
    background: linear-gradient(135deg, rgba(112, 33, 90, 0.2), var(--bg-card));
    border: 1px solid var(--plum);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.quick-win-label {
    font-size: 0.75rem;
    color: var(--pink);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.quick-win-card h3 { font-size: 1.2rem; color: #fff; margin-bottom: 8px; }
.qw-metric { color: var(--pink); font-weight: 700; margin-bottom: 8px; font-family: var(--font-title); }
.quick-win-card p { color: var(--text-muted); }

/* Category Breakdown */
.categories-section { padding: 40px 0; }
.categories-section h2 { font-size: 1.3rem; margin-bottom: 24px; color: #fff; }

.category-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.category-header:hover { background: var(--bg-hover); }
.category-header h3 {
    font-size: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.toggle-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.category-block.open .toggle-icon { transform: rotate(45deg); }
.category-body {
    display: none;
    padding: 0 20px 20px;
}
.category-block.open .category-body { display: block; }

.flag-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.flag-count-red { background: rgba(205, 29, 135, 0.2); color: var(--magenta); }
.flag-count-green { background: rgba(45, 106, 79, 0.2); color: var(--green-light); }

.flag-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.flag-row:last-child { border-bottom: none; }

.flag-status { flex-shrink: 0; padding-top: 2px; }
.flag-icon { font-size: 1rem; }
.flag-icon-red { color: var(--magenta); }
.flag-icon-green { color: var(--green-light); }

.flag-content { flex: 1; }
.flag-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    font-family: var(--font-title);
}
.flag-clear .flag-title { color: var(--text-muted); }

.severity-pill {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.severity-pill-critical { background: var(--magenta); }
.severity-pill-high { background: var(--purple); }
.severity-pill-medium { background: var(--orange); color: #000; }

.flag-metric { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 2px; }
.flag-threshold { font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; margin-bottom: 6px; }
.flag-insight { font-size: 0.9rem; color: var(--magenta); font-style: italic; margin-bottom: 4px; }
.flag-rec { font-size: 0.85rem; color: var(--text-muted); }
.flag-details { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.flag-details ul { list-style: none; margin-top: 4px; }
.flag-details li { padding: 2px 0; }
.flag-details code { background: var(--bg); padding: 1px 6px; border-radius: 3px; font-size: 0.8rem; }

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 48px 32px;
    background: linear-gradient(135deg, var(--plum), var(--bg));
    border: 1px solid var(--magenta);
    border-radius: var(--radius-lg);
    margin: 40px 0;
}
.cta-section h2 { font-size: 1.5rem; color: #fff; margin-bottom: 12px; }
.cta-section p { color: var(--text-muted); margin-bottom: 16px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-section em { color: var(--pink); }
.cta-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; }

.download-section {
    text-align: center;
    padding: 24px 0 40px;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===================================================================
   Responsive
   =================================================================== */

@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .flags-grid { grid-template-columns: 1fr; }
    .grade-hero { flex-direction: column; text-align: center; gap: 24px; }
    .grade-circle { width: 100px; height: 100px; }
    .grade-letter { font-size: 3rem; }
    .wtf-grid { grid-template-columns: 1fr; }
    .nav-actions { gap: 8px; flex-wrap: wrap; }
}
