/* ---
Modern UI/UX Redesign
Beautiful, functional interface with preserved typography and spacing
--- */

/* --- Global Styles & Fonts --- */
/* Poppins local font faces */
/* poppins-100 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 100;
    src: url('fonts/poppins-v23-latin-100.woff2') format('woff2');
}
/* poppins-100italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 100;
    src: url('fonts/poppins-v23-latin-100italic.woff2') format('woff2');
}
/* poppins-200 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 200;
    src: url('fonts/poppins-v23-latin-200.woff2') format('woff2');
}
/* poppins-200italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 200;
    src: url('fonts/poppins-v23-latin-200italic.woff2') format('woff2');
}
/* poppins-300 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 300;
    src: url('fonts/poppins-v23-latin-300.woff2') format('woff2');
}
/* poppins-300italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 300;
    src: url('fonts/poppins-v23-latin-300italic.woff2') format('woff2');
}
/* poppins-regular - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/poppins-v23-latin-regular.woff2') format('woff2');
}
/* poppins-italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 400;
    src: url('fonts/poppins-v23-latin-italic.woff2') format('woff2');
}
/* poppins-500 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    src: url('fonts/poppins-v23-latin-500.woff2') format('woff2');
}
/* poppins-500italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 500;
    src: url('fonts/poppins-v23-latin-500italic.woff2') format('woff2');
}
/* poppins-600 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/poppins-v23-latin-600.woff2') format('woff2');
}
/* poppins-600italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 600;
    src: url('fonts/poppins-v23-latin-600italic.woff2') format('woff2');
}
/* poppins-700 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/poppins-v23-latin-700.woff2') format('woff2');
}
/* poppins-700italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 700;
    src: url('fonts/poppins-v23-latin-700italic.woff2') format('woff2');
}
/* poppins-800 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 800;
    src: url('fonts/poppins-v23-latin-800.woff2') format('woff2');
}
/* poppins-800italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 800;
    src: url('fonts/poppins-v23-latin-800italic.woff2') format('woff2');
}
/* poppins-900 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 900;
    src: url('fonts/poppins-v23-latin-900.woff2') format('woff2');
}
/* poppins-900italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: italic;
    font-weight: 900;
    src: url('fonts/poppins-v23-latin-900italic.woff2') format('woff2');
}

:root {
    --brand-primary: #ff445a;
    --brand-primary-light: #fecaca;
    --brand-primary-dark: #e63946;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --surface-background: #f8fafc;
    --sidebar-background: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-text-accent: #ffffff;
    --border-color: #e2e8f0;
    --card-background: #ffffff;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-focus: 0 0 0 3px rgba(255, 69, 90, 0.15);
    --shadow-pass: 0 0 0 2px rgba(16, 185, 129, 0.35) inset;
    --shadow-fail: 0 0 0 2px rgba(239, 68, 68, 0.35) inset;

    /* Carousel motion (tweakable to match inspiration) */
    --carousel-duration: 480ms;
    --carousel-ease: cubic-bezier(0.165, 0.84, 0.44, 1); /* easeOutQuart-like */

    /* Background texture variables */
    --bg-base: #f8fafc;
    --bg-grad-top: #fbfdff;
    --bg-grad-bottom: #f6f9fc;
    --bg-pattern-color: rgba(15, 23, 42, 0.06); /* subtle slate dots */
    --bg-pattern-size: 14px; /* grid spacing */
    
    /* Button System Variables - Optimized for performance */
    --btn-transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    --btn-hover-lift: translateY(-1px);
    --btn-active-press: translateY(0px);
    --btn-hover-scale: scale(1.02);
    --btn-active-scale: scale(0.98);
    
    /* Mathematical Border Radius System - Based on "The Math Behind Nesting Rounded Corners" */
    /* Base radius values (reduced by ~40% for less rounded corners) */
    --radius-base: 5px;
    --radius-large: 10px;
    --radius-xl: 14px;
    --radius-2xl: 19px;
    --radius-full: 999px;
    
    /* Gap values for nested elements */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 12px;
    --gap-lg: 16px;
    --gap-xl: 20px;
    
    /* Calculated nested radii using the formula: outerRadius - gap = innerRadius */
    --radius-nested-xs: calc(var(--radius-base) - var(--gap-xs));
    --radius-nested-sm: calc(var(--radius-base) - var(--gap-sm));
    --radius-nested-md: calc(var(--radius-base) - var(--gap-md));
    --radius-nested-lg: calc(var(--radius-base) - var(--gap-lg));
    
    --radius-nested-large-xs: calc(var(--radius-large) - var(--gap-xs));
    --radius-nested-large-sm: calc(var(--radius-large) - var(--gap-sm));
    --radius-nested-large-md: calc(var(--radius-large) - var(--gap-md));
    --radius-nested-large-lg: calc(var(--radius-large) - var(--gap-lg));
    
    --radius-nested-xl-xs: calc(var(--radius-xl) - var(--gap-xs));
    --radius-nested-xl-sm: calc(var(--radius-xl) - var(--gap-sm));
    --radius-nested-xl-md: calc(var(--radius-xl) - var(--gap-md));
    --radius-nested-xl-lg: calc(var(--radius-xl) - var(--gap-lg));
    
    /* Legacy support - keeping old variable names for backward compatibility */
    --border-radius-sm: var(--radius-base);
    --border-radius-md: var(--radius-large);
    --border-radius-lg: var(--radius-xl);
    --border-radius-xl: var(--radius-2xl);
    --border-radius-full: var(--radius-full);
    --transition-speed: 0.2s; /* Reduced from 0.3s for better performance */
    /* Spacing scale */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-9: 36px;
    --space-10: 40px;
    --space-11: 44px;
    --space-12: 48px;
    --space-13: 52px;
    --space-14: 56px;
    --space-40: 160px;
    --space-45: 180px;
    
    /* Typography Scale - Based on current font sizes with systematic approach */
    /* Base font size: 15px */
    --font-size-xs: 0.75rem;      /* 11.25px - for small labels, captions */
    --font-size-sm: 0.8rem;       /* 12px - for secondary text, metadata */
    --font-size-base: 1rem;       /* 15px - base body text */
    --font-size-md: 1.05rem;      /* 15.75px - for emphasized body text */
    --font-size-lg: 1.1rem;       /* 16.5px - for larger body text */
    --font-size-xl: 1.4rem;       /* 21px - for subheadings */
    --font-size-2xl: 1.6rem;      /* 24px - for main headings */
    --font-size-3xl: 1.8rem;      /* 27px - for large headings */
    --font-size-4xl: 2.2rem;      /* 33px - for hero headings */
    --font-size-5xl: 2.5rem;      /* 37.5px - for welcome icons */
    
    /* Line Height Scale - Optimized for readability */
    --line-height-tight: 1.1;     /* For headings and large text */
    --line-height-snug: 1.2;      /* For subheadings */
    --line-height-normal: 1.35;   /* For body text and descriptions */
    --line-height-relaxed: 1.4;   /* For longer text blocks */
    --line-height-loose: 1.5;     /* For base body text */
    
    /* Font Weight Scale */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
}

/* --- Standardized Button System --- */
/* Base button styles that all buttons inherit */
button,
[role="button"],
.btn {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    transition: var(--btn-transition);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Standard hover state for all buttons */
button:hover,
[role="button"]:hover,
.btn:hover {
    transform: var(--btn-hover-lift);
}

/* Standard hover state for all buttons (with shadow override for close button) */
button:not(.example-modal-close):hover,
[role="button"]:not(.example-modal-close):hover,
.btn:not(.example-modal-close):hover {
    box-shadow: none;
}

/* Standard active state for all buttons */
button:active,
[role="button"]:active,
.btn:active {
    transform: var(--btn-active-press);
    will-change: opacity;
    backface-visibility: hidden; /* reduce composite artifacts */
}

/* Standard active state for all buttons (with shadow override for close button) */
button:not(.example-modal-close):active,
[role="button"]:not(.example-modal-close):active,
.btn:not(.example-modal-close):active {
    box-shadow: none;
}

/* Standard focus state for all buttons */
button:focus-visible,
[role="button"]:focus-visible,
.btn:focus-visible {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0) translateY(12px) scale(0.98); /* promote to its own layer */
    outline-offset: 2px;
    box-shadow: var(--shadow-focus);
}

/* Disabled state for all buttons */
button:disabled,
[role="button"]:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

button:disabled:hover,
[role="button"]:disabled:hover,
.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Button with icon hover effect */
button:hover .ph,
[role="button"]:hover .ph,
.btn:hover .ph {
    transform: scale(1.1);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Active button state */
button.active,
[role="button"].active,
.btn.active {
    transform: var(--btn-active-press);
    box-shadow: none;
}

/* Button group styling */
.btn-group {
    display: flex;
    border-radius: var(--radius-base);
    overflow: hidden;
}

.btn-group button,
.btn-group [role="button"],
.btn-group .btn {
    border-radius: 0;
    margin: 0;
    border-right: 1px solid var(--border-color);
}

.btn-group button:first-child,
.btn-group [role="button"]:first-child,
.btn-group .btn:first-child {
    border-radius: var(--radius-base) 0 0 var(--radius-base);
}

.btn-group button:last-child,
.btn-group [role="button"]:last-child,
.btn-group .btn:last-child {
    border-radius: 0 var(--radius-base) var(--radius-base) 0;
    border-right: none;
}

.btn-group button:hover,
.btn-group [role="button"]:hover,
.btn-group .btn:hover {
    z-index: 1;
    position: relative;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    /* Layered gradient + subtle grid dot pattern for a more noticeable texture */
    background:
        /* Overlay that fades pattern away as it goes to the top */
        linear-gradient(to top, transparent 28%, var(--bg-grad-top) 100%),
        /* Pattern layer */
        radial-gradient(circle at 1px 1px, var(--bg-pattern-color) 1px, transparent 1.5px) 0 0 / var(--bg-pattern-size) var(--bg-pattern-size),
        /* Base gradient */
        linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom));
    background-color: var(--bg-base); /* fallback color */
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden; /* Prevent scrolling on body */
    height: 100vh;
    font-size: var(--font-size-base); /* Base font size for the entire app */
    line-height: var(--line-height-loose); /* Standard line height for better readability */
}

/* --- Main Layout --- */
.main-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Navigation Panel (Sidebar) --- */
.navigation-panel {
    width: 280px; /* Increased from 220px to prevent text truncation */
    height: 100vh;
    background: #1f1a3a;
    color: white;
    padding: var(--space-3) var(--space-2); /* Reduced padding */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: fixed;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    border-right: 1px solid rgba(255, 69, 90, 0.3);
}

.logo-container {
    padding: var(--space-3) var(--space-4) var(--space-4) var(--space-4); /* Tighter padding */
    margin-bottom: var(--space-1); /* Reduced margin */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-content {
    text-align: left;
}

.logo {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-extrabold);
    color: white;
    text-shadow: var(--shadow-sm);
    position: relative;
    z-index: 2;
    letter-spacing: -0.02em;
    margin-bottom: 0; /* Tighter spacing */
    line-height: var(--line-height-tight);
}

.logo-subtitle {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 2;
    margin-top: 2px; /* Back to original spacing */
}

/* Language Toggle Button */
.language-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-base);
    padding: var(--space-1) var(--space-2);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    min-width: 40px;
    justify-content: center;
    transition: var(--btn-transition);
    box-shadow: var(--shadow-sm);
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: var(--btn-hover-scale);
    box-shadow: var(--shadow-sm);
}

.language-toggle:active {
    transform: var(--btn-active-scale);
}

.language-code {
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.5px;
}

.language-toggle .ph {
    font-size: var(--font-size-base);
    opacity: 0.8;
}

#channel-list {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.channel-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-1) var(--space-1) var(--space-1);
    transition: color 0.2s ease;
    margin-top: var(--space-1);
}

.channel-header.active {
    color: var(--brand-primary);
}

.channel-header .ph {
    font-size: var(--font-size-xl);
    width: 24px;
    text-align: center;
    color: var(--brand-primary);
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.placement-list-container {
    padding: 0;
    margin: 0 0 var(--space-2) 0; /* Reduced from 15px */
}

.placement-item {
    padding: 5px 6px 6px 36px;
    border-radius: var(--radius-base);
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative; /* For focus outline positioning */
    margin-bottom: 2px;
    word-wrap: break-word; /* Allow long words to break */
    hyphens: auto; /* Enable automatic hyphenation */
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.placement-item:hover {
    background: rgba(255, 69, 90, 0.15);
    color: #fff;
}

.placement-item:active {
    background: rgba(255, 69, 90, 0.22);
}

.placement-item:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.placement-item.active {
    background: var(--brand-primary);
    color: white;
    font-weight: var(--font-weight-semibold);
    position: relative;
    box-shadow: var(--shadow-md);
}

.placement-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 0 var(--gap-xs) var(--gap-xs) 0;
    box-shadow: var(--shadow-sm);
}

/* Disclaimer icons (Amazon Video) */
.placement-card h2 .placement-disclaimer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--space-1);
    color: var(--brand-primary);
}

.placement-card h2 .placement-disclaimer .ph {
    font-size: var(--font-size-sm);
}

/* Tooltip styling for placement disclaimer */
.placement-disclaimer { position: relative; cursor: help; }
.placement-disclaimer .tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--card-background);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-sm);
    padding: var(--space-2) var(--space-2);
    font-size: var(--font-size-sm); /* decouple from h2 size */
    line-height: 1.35;
    font-weight: 400; /* avoid inheriting h2 bold weight */
    max-width: 360px;
    width: max-content;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: transform, opacity;
}
.placement-disclaimer:hover .tooltip,
.placement-disclaimer:focus-within .tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Global tooltip style for elements using data-tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--card-background);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-sm);
    padding: var(--space-2) var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.35;
    max-width: 360px;
    width: max-content;
    z-index: 3000; /* Ensure above cards and headers */
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: transform, opacity;
}
[data-tooltip].tooltip-fixed-active::after {
    position: fixed;
    top: var(--tt-top, 0);
    left: var(--tt-left, 0);
}

/* Global tooltip container (above everything) */
html.tooltips-global #global-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    /* Always render for measurement; hide via opacity to enable transitions */
    display: block;
    background: var(--card-background);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.35;
    max-width: 360px;
    z-index: 9999;
    opacity: 0;
    transform: scale(0.9);
    transform-origin: var(--transform-origin, top center);
    transition: transform 150ms ease, opacity 150ms ease;
    pointer-events: none;
}
html.tooltips-global #global-tooltip.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* When global tooltip system is enabled, hide legacy per-element tooltip */
html.tooltips-global [data-tooltip]::after {
    display: none;
}

/* --- Content Panel (Main Area) --- */
.content-panel {
    width: 900px; /* Fixed width instead of max-width */
    margin: 0 auto;
    margin-left: calc(280px + (100vw - 280px - 900px) / 2); /* Center the content panel */
    padding: var(--space-4) var(--space-8) var(--space-8) var(--space-8); /* Added bottom padding for consistent spacing */
    height: 100vh;
    overflow-y: auto; /* Allow scrolling on the main container */
    overflow-x: hidden;
    box-sizing: border-box;
    background: transparent; /* let body texture show through */
}

/* Two-column content body: details + examples */
/* content-body removed (modal replaces side panel) */

header {
    margin-bottom: var(--space-3); /* Reduced margin */
    background: var(--surface-background);
    padding: var(--space-4) 0 var(--space-3) 0; /* Reduced padding */
    z-index: 100;
    position: relative; /* enable z-index stacking above content header */
    backdrop-filter: blur(5px); /* Reduced blur for better performance */
    display: none; /* Hide header since search is removed */
}

/* Search container removed */

/* Search icon removed */

/* Search input removed */

/* Search input focus removed */

/* Search icon focus removed */

/* Search results container removed */

/* Search results visible state removed */

/* Search result item removed */

/* Search result item states and content removed */

/* Search result active states removed */

/* Search highlight removed */

/* No results styling removed */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0; /* Reduced padding */
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-4); /* Reduced margin */
    width: 100%;
    height: var(--space-13); /* Reduced height */
    background: transparent;
    position: relative; /* Ensure stacking context above content */
    z-index: 1000;
    backdrop-filter: blur(3px); /* light blur over textured background */
}

.content-header-main h1 {
    font-size: var(--font-size-2xl); /* Slightly reduced */
    font-weight: var(--font-weight-bold);
    margin: 0;
    color: var(--brand-primary);
    line-height: var(--line-height-snug); /* Added for better text spacing */
}

.content-header p {
    font-size: var(--font-size-sm); /* Slightly reduced */
    color: var(--text-secondary);
    margin: 2px 0 0 0; /* Reduced margin */
    line-height: var(--line-height-relaxed); /* Added for better text spacing */
}

/* Criteria content area */
#placement-details {
    padding-bottom: var(--space-8); /* Consistent bottom spacing */
    min-height: calc(100vh - 200px); /* Ensure minimum height for consistent layout */
}

/* Modal styles for examples */
.example-modal[hidden] { display: none; }
.example-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    opacity: 0;
    transition: opacity 150ms ease;
    will-change: opacity;
    overflow: visible; /* allow button shadows to render */
}
.example-modal-backdrop {
    position: absolute;
    inset: 0;
    overflow: hidden; /* clip sliding track inside viewport */
    background: rgba(15, 23, 42, 0.55); /* restore darkening overlay without blur */
    /* Remove backdrop blur to avoid expensive paint on modal open */
    /* backdrop-filter: blur(1px); */
    opacity: 0;
    transition: opacity 150ms ease;
    will-change: opacity;
}
.example-modal-dialog {
    position: relative;
    width: min(720px, calc(100vw - 48px));
    margin: 8vh auto;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transform: translateZ(0) translateY(12px) scale(0.98);
    opacity: 0.001;
    transition: transform 200ms cubic-bezier(.22,.61,.36,1), opacity 180ms ease;
    will-change: transform, opacity;
    backface-visibility: hidden;
    overflow: hidden; /* keep modal content within rounded bounds */
}
.example-modal.show { opacity: 1; }
.example-modal.show .example-modal-backdrop { opacity: 1; }
.example-modal.show .example-modal-dialog { transform: none; opacity: 1; }
.example-modal-content {
    padding: var(--space-5) var(--space-5); /* match card padding */
}
.example-modal-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: transparent;
    width: var(--space-8);
    height: var(--space-8);
    border-radius: var(--radius-base);
    color: var(--text-secondary);
    transition: var(--btn-transition);
}

.example-modal-close:hover { 
    background: rgba(148, 163, 184, 0.15); 
    color: var(--text-primary); 
}

/* Modal title and lead text */
.example-modal-content > h3 {
    margin: 0 0 4px 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-extrabold);
    letter-spacing: -0.02em;
    color: var(--brand-primary);
    line-height: var(--line-height-tight);
}
.example-modal-content > h3 .ph { font-size: var(--font-size-sm); vertical-align: -2px; margin-right: var(--space-1); }
.example-modal-content > p:first-of-type {
    margin-top: 0;
    margin-bottom: var(--space-4); /* Consistent spacing below title */
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    line-height: var(--line-height-normal);
}
.modal-criteria-description { 
    margin: 0 0 var(--space-4) 0; /* Consistent spacing below description */
}

/* Reuse visual components inside modal */
.example-visual { 
    margin-top: var(--space-4); /* Consistent spacing from criteria description */
    border: 1.5px dashed var(--border-color); 
    border-radius: var(--radius-large); 
    overflow: hidden; 
    background: linear-gradient(180deg, #fbfdff, #f6f9fc); 
}
.example-visual .visual-body { 
    padding: var(--space-4); /* Consistent padding with visual tiles */
}
.visual-matrix { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: var(--space-4); /* Consistent gap between example boxes */
    align-items: stretch;
}
.visual-tile { 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-large); 
    padding: var(--space-4); /* Increased padding for better breathing room */
    display: flex; 
    flex-direction: column; 
    gap: var(--space-2); /* Consistent gap between elements */
    background: #fff; 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
    position: relative; 
    will-change: transform;
}
.visual-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.visual-tile.pass { box-shadow: var(--shadow-pass); border-color: rgba(16, 185, 129, 0.25); }
.visual-tile.fail { box-shadow: var(--shadow-fail); border-color: rgba(239, 68, 68, 0.25); }
.visual-tile.pass::before,
.visual-tile.fail::before {
    content: attr(data-badge);
    content: unset; /* default off; JS-free fallback below */
}
/* Badge using pseudo (no extra markup) */
.visual-tile.pass::after,
.visual-tile.fail::after {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    content: "";
}
.visual-tile.pass { position: relative; }
.visual-tile.fail { position: relative; }
.visual-tile.pass::after { content: "✔ Pass"; background: rgba(16,185,129,0.12); color: #0f766e; border: 1px solid rgba(16,185,129,0.35); }
.visual-tile.fail::after { content: "✖ Fail"; background: rgba(239,68,68,0.12); color: #9f1239; border: 1px solid rgba(239,68,68,0.35); }
.visual-tile.pass::after,
.visual-tile.fail::after {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.2px;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    top: var(--space-1);
    left: var(--space-1);
    z-index: 1;
}

/* Hide pass/fail pill tags (keep pass/fail styling like borders/shadows) */
.visual-tile.pass::after,
.visual-tile.fail::after { content: none !important; }
.visual-tile .thumb { background: linear-gradient(180deg, #e7eef6, #eaf0f8); height: var(--space-40); border-radius: var(--radius-large); display: grid; place-items: center; color: var(--text-tertiary); font-size: var(--font-size-base); }
.thumb .example-video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: var(--radius-large); 
    overflow: hidden; 
    display: block; 
    /* Inactive look by default */
    filter: grayscale(100%) brightness(0.85) contrast(0.9);
    transition: filter 180ms ease, opacity 150ms ease;
}
/* Restore full color on hover and while playing */
.visual-tile:hover .thumb .example-video,
.visual-tile.playing .thumb .example-video {
    filter: none;
}
.thumb .example-image { width: 100%; height: auto; object-fit: contain; border-radius: var(--radius-large); display: block; }
.visual-tile .thumb { transition: opacity 150ms ease; }
.visual-tile:hover .thumb { opacity: 0.98; }
.visual-tile .thumb.is-image { filter: none !important; }
.visual-tile .thumb { position: relative; }
.play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; pointer-events: none; transition: opacity 120ms ease, transform 120ms ease; z-index: 2; will-change: opacity, transform; }
.play-overlay .ph { background: rgba(0,0,0,0.5); color: #fff; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-full); font-size: var(--font-size-4xl); box-shadow: var(--shadow-sm); }
.visual-tile.playing .play-overlay { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
.visual-tile .thumb { position: relative; overflow: hidden; }
.visual-tile .thumb.is-image { height: auto; background: #fff; }
.visual-tile.pass .thumb::before,
.visual-tile.fail .thumb::before {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: grid;
    place-items: center;
    font-size: 16px;
    color: #ffffff;
    box-shadow: var(--shadow-sm);
    z-index: 3;
}
.visual-tile.pass .thumb::before { content: "✓"; background: #10b981; }
.visual-tile.fail .thumb::before { content: "✕"; background: #ef4444; }
.visual-tile .thumb.grid-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--brand-primary) 1px, transparent 1px),
        linear-gradient(to bottom, var(--brand-primary) 1px, transparent 1px);
    background-size: calc(100% / 8) 100%, 100% calc(100% / 5);
    pointer-events: none;
    z-index: 1;
    opacity: 0.35;
    border-radius: var(--radius-large); /* match video corner radius */
}
.video-timeline { 
    display: grid; 
    grid-template-columns: 1fr auto; 
    align-items: center; 
    gap: var(--space-2); 
}
.video-timeline .bar { position: relative; height: var(--space-1); background: #e5e7eb; border-radius: var(--radius-full); overflow: hidden; transform: translateZ(0); }
.video-timeline .progress { position: absolute; left: 0; top: 0; height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0); background: var(--brand-primary); opacity: 0.6; will-change: transform; transform: translateZ(0); }
.video-timeline .time { font-size: var(--font-size-xs); color: var(--text-tertiary); }
.visual-caption { 
    font-size: var(--font-size-sm); 
    color: var(--text-secondary); 
    line-height: var(--line-height-normal);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    hyphens: auto;
    /* Reserve exactly two lines of height, regardless of text length */
    height: calc(2 * var(--line-height-normal) * 1em); /* fallback based on numeric line-height */
    height: calc(2lh); /* uses the element's computed line-height when supported */
}
/* Keep placeholder content visible inside thumbs (for non-video/image examples) */
.thumb svg { display: block; }
.thumb div { display: block; }

/* Do not hide overlay play icon */
.visual-tile .thumb .play-overlay .ph { display: grid; }

@media (max-width: 620px) {
    .visual-matrix { grid-template-columns: 1fr; }
}

/* Example slider */
.examples-slider { 
    position: relative; 
    padding: 0 0 var(--space-2) 0; /* bottom padding gives room for button shadows */
    min-height: 120px; /* Ensure consistent height for examples section */
    overflow: hidden; /* viewport clipping for sliding track */
    border-radius: var(--radius-lg);
}
.examples-slider .slider-header { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    gap: var(--space-3); 
    margin-top: var(--space-4); /* Consistent spacing below header */
}
.examples-slider .slider-count { 
    font-size: var(--font-size-xs); 
    font-weight: var(--font-weight-normal); 
    color: var(--text-secondary); 
    text-transform: none;
    letter-spacing: 0.08em;
    padding: 0;
    border: none;
    background: transparent;
}
.examples-slider .slider-count .current,
.examples-slider .slider-count .total { color: inherit; }
.examples-slider .slider-btn { 
    width: var(--space-6); 
    height: var(--space-6); 
    display: grid; 
    place-items: center; 
    border-radius: var(--radius-full); 
    border: 1px solid var(--border-color); 
    background: transparent; 
    box-shadow: var(--shadow-sm); 
    color: var(--text-secondary); 
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.25s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    will-change: transform;
}
.examples-slider .slider-btn .ph { font-size: 12px; }


.examples-slider .slides {
    position: relative;
    min-height: 0;
    overflow: visible; /* track can overflow horizontally; viewport clips */
    display: flex;
    width: 100%;
    transform: translateX(0);
    transition: transform var(--carousel-duration) var(--carousel-ease);
    will-change: transform;
}
/* Embla-inspired horizontal slide animation on container; individual slides are full-width panels */
.examples-slider .slide {
    position: relative;
    flex: 0 0 100%;
    opacity: 1;
    transform: none;
    transition: none;
    pointer-events: auto;
    z-index: auto;
}
.examples-slider .slide.active { z-index: auto; }
.examples-slider .slide.prep,
.examples-slider .slide.leaving { /* no-op with container translate */
    opacity: 1;
    transform: none;
}
 

/* Visual tile entrance animation */
/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    .examples-slider .slides,
    .examples-slider .slide,
    .examples-slider .slide.active,
    .examples-slider .slide.prep,
    .examples-slider .slide.leaving {
        transition: none !important;
        transform: none !important;
    }
}

.placement-card,
.welcome-card {
    width: 100%;
    box-sizing: border-box; /* Ensures padding is included in the width */
}

#placement-details .welcome-card {
    background: var(--card-background);
    padding: var(--space-6) var(--space-5); /* Reduced padding */
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
    min-height: 280px; /* Reduced height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#placement-details .placement-card {
    background: var(--card-background);
    padding: var(--space-5) var(--space-5); /* Reduced padding */
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
    min-height: 280px; /* Reduced height */
    margin-bottom: var(--space-8); /* Consistent bottom spacing for examples section */
}

.welcome-card {
    text-align: center;
}

/* Page disclaimer */
.page-disclaimer {
    position: fixed;
    /* center relative to the content panel’s centered column */
    left: calc(280px + (100vw - 280px - 900px) / 2);
    width: 900px;
    bottom: 10px;
    text-align: center;
    padding: 0;
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    border-radius: 0;
    font-size: var(--font-size-xs);
    box-shadow: none;
    z-index: 9000; /* below modal (10000) */
    pointer-events: none;
}

.welcome-icon {
    font-size: var(--font-size-5xl); /* Reduced size */
    color: var(--brand-primary);
    margin-bottom: var(--space-4); /* Reduced margin */
}

#placement-details h2 {
    margin: 0 0 var(--space-4) 0; /* Increased bottom margin for better separation */
    font-size: var(--font-size-4xl); /* Increased size for better prominence */
    font-weight: var(--font-weight-extrabold); /* Bolder weight for stronger presence */
    color: var(--brand-primary);
    line-height: var(--line-height-tight); /* Tighter line height for better typography */
    letter-spacing: -0.02em; /* Slightly tighter letter spacing */
}

#placement-details ul {
    list-style: none;
    padding: 0;
}

#placement-details li {
    background: var(--card-background);
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3); /* Equal top and bottom padding */
    margin-bottom: var(--space-2); /* Reduced margin */
    border: none;
    border-radius: var(--radius-large);
    display: flex;
    flex-direction: row; /* Align icon and content side-by-side */
    align-items: flex-start; /* Align icon to the top with the title */
    gap: var(--space-3); /* Reduced gap */
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%; /* Ensure the li takes full width */
    box-sizing: border-box; /* Ensure padding is included in the width */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    will-change: transform;
}

/* Criteria cards are not clickable; only the play button triggers examples */
#placement-details li[data-examples="true"] { cursor: default; }

.spec-content {
    flex: 1; /* Make the div take all available space */
    min-width: 0; /* Allow the div to shrink below its content size */
    width: 100%; /* Ensure it uses full width */
    display: flex;
    flex-direction: column;
    gap: var(--space-1); /* Reduced gap between title and description */
    padding-left: 0; /* Keep left aligned with icon */
    padding-right: 8px; /* Add spacing from right border */
}

.tag-container {
    display: flex;
    justify-content: flex-start; /* Align to the left instead of space-between */
    align-items: flex-start;
    width: 100%;
    margin-bottom: var(--space-1); /* Reduced margin */
    gap: var(--space-2);
}

#placement-details li.not-applicable {
    opacity: 0.4;
    background: #f8f8f8;
}

#placement-details li:hover {
    background: var(--surface-background);
    transform: var(--btn-hover-lift); /* subtle lift like buttons */
    box-shadow: var(--shadow-sm); /* consistent subtle elevation */
}

#placement-details li:last-child {
    border-bottom: none;
}

.spec-icon .ph {
    font-size: var(--font-size-xl); /* Reduced size */
    color: var(--brand-primary);
    width: 24px; /* Reduced width */
    text-align: center;
    margin-top: 0.1em; /* Fine-tune alignment with title text baseline */
    flex-shrink: 0; /* Prevent icon from shrinking */
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag {
    background: transparent;
    color: var(--brand-primary);
    padding: 2px 8px; /* Reduced padding */
    border-radius: var(--radius-base);
    font-size: var(--font-size-xs); /* Reduced size */
    font-weight: var(--font-weight-semibold);
    display: inline-block;
    letter-spacing: 0.02em; /* Improved readability for small text */
    text-transform: uppercase; /* Makes tags stand out better */
    white-space: nowrap; /* Prevent tag text from wrapping */
    border: 1px solid var(--brand-primary);
    margin-right: 0;
}

/* Inline "See example" CTA inside criteria tags */
.example-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: #fff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    box-shadow: none;
}
.example-cta .ph { font-size: var(--font-size-sm); color: var(--brand-primary); }
.example-cta .label { letter-spacing: 0.02em; }
.example-cta:hover {
    background: var(--surface-background);
    color: var(--text-primary);
    box-shadow: none;
}
.example-cta:active { box-shadow: none; }
.example-cta:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

#placement-details li strong {
    font-weight: var(--font-weight-semibold);
    color: var(--brand-primary);
    display: block;
    font-size: var(--font-size-base); /* Reduced size */
    margin-bottom: 0; /* Remove margin since we're using flex gap */
}

.spec-description {
    color: var(--text-secondary);
    font-size: var(--font-size-sm); /* Reduced size */
    line-height: var(--line-height-loose); /* Reduced line height */
    width: 100%; /* Use full width */
    margin: 0; /* Remove default margins */
    padding: 0; /* No added padding except right */
    padding-right: 8px; /* Increase only right side */
    text-indent: 0; /* Ensure no text indentation */
}

/* --- Toggles --- */
.toggles-container {
    display: flex;
    gap: var(--space-4); /* Reduced gap */
    align-items: center;
}

/* Modern Asset Toggle */
.asset-toggle {
    display: flex;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    padding: 0; /* Remove padding to allow buttons to touch edges */
    width: var(--space-45); /* Reduced width */
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
    overflow: hidden; /* Ensure buttons don't overflow rounded corners */
}
/* Remove inner divider from generic .btn-group inside this component */
.asset-toggle button { border-right: 0 !important; }

/* 50% sliding active background for perfect equal halves */
.asset-toggle::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background: var(--brand-primary);
    border-radius: var(--radius-base);
    transform: translateX(0%);
    transition: transform 220ms cubic-bezier(.2,.7,.2,1);
    z-index: 0;
}

/* When Image is active, move the underlay to the right half */
.asset-toggle:has(.asset-toggle-btn[data-type="image"].active)::before,
.asset-toggle:has(.asset-toggle-btn:last-child.active)::before {
    transform: translateX(100%);
}

.asset-toggle:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.asset-toggle-btn {
    flex: 1;
    padding: var(--space-2) var(--space-3); /* Reduced padding */
    background-color: transparent;
    border-radius: 0;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm); /* Reduced size */
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1); /* Reduced gap */
    position: relative;
    z-index: 2;
    line-height: 1.2;
    height: var(--space-8); /* Reduced height */
    transition: var(--btn-transition);
}

/* Round only the outer corners of the toggle */
.asset-toggle-btn:first-child {
    border-radius: var(--radius-base) 0 0 var(--radius-base);
}

.asset-toggle-btn:last-child {
    border-radius: 0 var(--radius-base) var(--radius-base) 0;
}

.asset-toggle-btn .ph {
    font-size: var(--font-size-base); /* Reduced size */
    transition: var(--btn-transition);
}


/* Consistent hover/active styles for asset toggle buttons */
/* Consistent hover/active styles for asset toggle buttons */
.asset-toggle-btn:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 69, 90, 0.08);
}

.asset-toggle-btn:hover .ph {
    transform: scale(1.1);
}

.asset-toggle-btn:active {
    transform: none;
    background: rgba(255, 69, 90, 0.14);
}
.asset-toggle-btn:active { transform: none; }

/* Active state: text sits on red underlay, must be white for contrast */
.asset-toggle-btn.active {
    background: transparent; /* underlay provides background */
    color: #fff;
    font-weight: var(--font-weight-semibold);
}

.asset-toggle-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.asset-toggle-btn.active .ph {
    color: white;
}

.asset-toggle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: transparent !important;
    color: var(--text-tertiary) !important;
}

.asset-toggle-btn:disabled:hover {
    background-color: transparent;
    color: var(--text-tertiary);
    transform: none;
}

.asset-toggle-btn:disabled .ph {
    transform: none;
    color: var(--text-tertiary) !important;
}

/* Accessibility: ensure readable text when red underlay is present but JS hasn't applied .active yet */
.asset-toggle:not(:has(.asset-toggle-btn.active)) .asset-toggle-btn:first-child {
    color: #fff;
    font-weight: var(--font-weight-semibold);
}
.asset-toggle:not(:has(.asset-toggle-btn.active)) .asset-toggle-btn:first-child .ph {
    color: #fff;
}

/* Petcare Bookmark Styling */
.has-petcare-variant {
    position: relative;
}

.petcare-bookmark {
    position: absolute;
    top: var(--space-3);
    right: var(--space-4);
    width: 24px;
    height: 24px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

.petcare-bookmark:hover {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: var(--btn-hover-scale);
    box-shadow: var(--shadow-sm);
}

.petcare-bookmark.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-sm);
    transform: var(--btn-active-scale);
}

.petcare-bookmark .ph {
    font-size: var(--font-size-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.petcare-bookmark:hover .ph {
    transform: scale(1.1);
}

.petcare-bookmark.active .ph {
    transform: var(--btn-active-scale);
}

/* Example bookmark (play icon) - same visual language as petcare */
.example-bookmark {
    position: absolute;
    top: var(--space-3);
    right: var(--space-4);
    width: 24px;
    height: 24px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 9; /* slightly below petcare if both exist */
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

/* When both exist, stack horizontally: petcare on the far right, example to its left */
.has-petcare-variant .petcare-bookmark + .example-bookmark,
.has-petcare-variant .example-bookmark + .petcare-bookmark {
    right: calc(var(--space-4) + 28px);
}

.example-bookmark:hover {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: var(--btn-hover-scale);
    box-shadow: var(--shadow-sm);
}

.example-bookmark .ph {
    font-size: var(--font-size-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.example-bookmark:hover .ph { transform: scale(1.1); }

/* --- Custom Scrollbar Styling --- */
/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: var(--space-2);
    height: var(--space-2);
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--gap-xs);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 69, 90, 0.3);
    border-radius: var(--gap-xs);
    border: 1px solid rgba(255, 69, 90, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 69, 90, 0.5);
}

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 69, 90, 0.3) transparent;
}

/* Sidebar specific scrollbar */
.navigation-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navigation-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Content panel scrollbar */
.content-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 69, 90, 0.3);
    border: 1px solid rgba(255, 69, 90, 0.1);
}

.content-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 69, 90, 0.5);
}

/* Search results scrollbar removed */

/* Search results scrollbar hover removed */

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    left: -999px;
    top: -999px;
    background: #000;
    color: #fff;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--gap-xs);
    z-index: 1000;
}
.skip-link:focus {
    left: var(--space-4);
    top: var(--space-4);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    .placement-item:hover,
    .petcare-bookmark:hover,
    .asset-toggle-btn:hover {
        transform: none !important;
    }
}

/* Performance optimizations for animations */
@media (prefers-reduced-motion: no-preference) {
    /* Enable hardware acceleration for transform animations */
    .placement-item,
    .visual-tile,
    .examples-slider .slide,
    .examples-slider .slider-btn,
    .petcare-bookmark,
    button,
    [role="button"],
    .btn {
        transform: translateZ(0);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    /* Optimize backdrop filters */
    header,
    .content-header,
    .example-modal-backdrop {
        transform: translateZ(0);
        will-change: backdrop-filter;
    }
}

/* Responsive layout adjustments */
@media (max-width: 1280px) {
    .content-panel {
        width: calc(100vw - 280px);
        margin-left: 280px;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }
    .main-container {
        flex-direction: column;
        height: auto;
    }
    .navigation-panel {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 69, 90, 0.3);
    }
    .content-panel {
        margin: 0;
        width: 100%;
        height: auto;
        padding: var(--space-4);
    }
}

/* --- Mathematical Border Radius System Examples --- */
/* These classes demonstrate the proper use of nested border radii */

/* Example 1: Card with nested content */
.card-outer {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    padding: var(--space-4);
}

.card-inner {
    background: var(--surface-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-nested-large-sm); /* radius-large - gap-sm */
    padding: var(--space-3);
}

/* Example 2: Button with nested icon */
.button-outer {
    background: var(--brand-primary);
    border: none;
    border-radius: var(--radius-base);
    padding: var(--space-2) var(--space-4);
    color: white;
}

.button-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-nested-xs); /* radius-base - gap-xs */
    padding: var(--space-1);
    margin-left: var(--space-2);
}

/* Example 3: Modal with nested form */
.modal-outer {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
}

.modal-form {
    background: var(--surface-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-nested-xl-md); /* radius-xl - gap-md */
    padding: var(--space-4);
}

/* Example 4: Navigation with nested items */
.nav-outer {
    background: var(--sidebar-background);
    border-radius: var(--radius-base);
    padding: var(--space-2);
}

.nav-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-nested-sm); /* radius-base - gap-sm */
    padding: var(--space-2);
    margin-bottom: var(--space-1);
}

/* Example 5: Input with nested focus state */
.input-outer {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    padding: var(--space-2);
}

.input-outer:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(255, 69, 90, 0.15);
    border-radius: var(--radius-base); /* Keep same radius for focus */
}

/* Example 6: Dropdown with nested options */
.dropdown-outer {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    padding: var(--space-2);
}

.dropdown-option {
    background: var(--surface-background);
    border-radius: var(--radius-nested-sm); /* radius-base - gap-sm */
    padding: var(--space-2);
    margin: var(--space-1) 0;
}

/* Example 7: Progress bar with nested indicator */
.progress-outer {
    background: var(--border-color);
    border-radius: var(--radius-full);
    height: var(--space-2);
    overflow: hidden;
}

.progress-inner {
    background: var(--brand-primary);
    border-radius: var(--radius-full); /* Same radius for progress bar */
    height: 100%;
    transition: width 0.2s ease;
    will-change: width;
}

/* Example 8: Avatar with nested status indicator */
.avatar-outer {
    background: var(--brand-primary);
    border-radius: var(--radius-full);
    width: var(--space-10);
    height: var(--space-10);
    position: relative;
}

.avatar-status {
    background: var(--brand-primary-dark);
    border: 2px solid var(--card-background);
    border-radius: var(--radius-full);
    width: var(--space-3);
    height: var(--space-3);
    position: absolute;
    bottom: 0;
    right: 0;
}

/* Example 9: Badge with nested text */
.badge-outer {
    background: var(--brand-primary-light);
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-base);
    padding: var(--space-1) var(--space-2);
    display: inline-flex;
    align-items: center;
}

.badge-text {
    background: var(--brand-primary);
    color: white;
    border-radius: var(--radius-nested-xs); /* radius-base - gap-xs */
    padding: var(--space-1);
    margin-left: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

/* Example 10: Tooltip with nested arrow */
.tooltip-outer {
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-base);
    padding: var(--space-2) var(--space-3);
    position: relative;
}

.tooltip-arrow {
    background: var(--text-primary);
    border-radius: var(--radius-nested-xs); /* radius-base - gap-xs */
    width: var(--space-2);
    height: var(--space-2);
    position: absolute;
    top: 50%;
    left: calc(-1 * var(--space-1));
    transform: translateY(-50%) rotate(45deg);
}