/* Domain Specific Styles */

/* Universal Browser Compatibility - All Browsers */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

html {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff !important;
    color: #333333 !important;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Reset for all browsers */
h1, h2, h3, h4, h5, h6, p, ul, ol, li, div, span {
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* Cross-Browser Flexbox Support */
.flex {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}

/* Browser Specific Fixes */
/* Internet Explorer */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .modal {
        display: -ms-flexbox;
        -ms-flex-align: center;
        -ms-flex-pack: center;
    }
}

/* Edge Legacy */
@supports (-ms-ime-align: auto) {
    .modal {
        display: -ms-flexbox;
        -ms-flex-align: center;
        -ms-flex-pack: center;
    }
}

:root {
    --accent-color: #ff6b6b;
    --info-color: #4dabf7;
    --warning-color: #ffd43b;
    --success-color: #51cf66;
    --purple-color: #9775fa;
    --background-light: #f8fafc;
    --text-primary: #1a202c;
    --border-color: #e2e8f0;
    --gradient-accent: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Domain Hero Section */
.domain-hero {
    /* Cross-browser gradient support */
    background: #667eea; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -ms-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -o-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0 60px;
    color: white;
}

.domain-hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 20px;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
}

.breadcrumb i {
    margin: 0 10px;
    font-size: 12px;
}

.domain-title {
    display: flex;
    align-items: center;
    gap: 30px;
    text-align: left;
}

.domain-title h1 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.domain-title h1::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.domain-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.observing-icon { background: #4ade80; }
.understanding-icon { background: #f59e0b; }
.thinking-icon { background: #8b5cf6; }
.deciding-icon { background: #ef4444; }
.performing-icon { background: #06b6d4; }
.experiencing-icon { background: #ec4899; }
.repeating-icon { background: #10b981; }

.domain-code-large {
    display: inline-block;
    font-size: 24px;
    font-weight: 300;
    opacity: 0.8;
    margin-left: 0;
}

.domain-hero-desc {
    font-size: 18px;
    margin: 15px 0 0;
    opacity: 0.9;
    max-width: 600px;
}

/* Growth Dimensions Section */
.growth-dimensions {
    padding: 5rem 0;
    background: var(--background-light);
}

.dimensions-chart {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-light);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.legend-item:hover {
    background: var(--background-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.legend-item:hover .legend-color {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* The 5 main dimension tags used in the bars: */

.bar-fill.sensory { background: var(--accent-color); }     /* Physical senses */
.bar-fill.cognitive { background: var(--info-color); }     /* Mental processes */
.bar-fill.emotional { background: var(--warning-color); }  /* Feelings & emotions */
.bar-fill.social { background: var(--success-color); }     /* Social interactions */
.bar-fill.spiritual { background: var(--purple-color); }   /* Meaning & purpose */

/* Legend colors match the bars: */
.legend-color.sensory { background: var(--accent-color); }
.legend-color.cognitive { background: var(--info-color); }
.legend-color.emotional { background: var(--warning-color); }
.legend-color.social { background: var(--success-color); }
.legend-color.spiritual { background: var(--purple-color); }

.dimensions-grid {
    display: grid;
    gap: 1rem;
}

.dimension-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.dimension-row:hover {
    background: var(--background-light);
    transform: translateX(8px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-medium);
}

.dimension-row.hovered {
    background: var(--background-light);
    transform: translateX(8px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-heavy);
}

.subdomain-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.subdomain-name::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.14);
    color: #667eea;
    font-size: 0.62rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dimension-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    height: 24px;
}

.bar-fill {
    border-radius: 6px;
    transition: all 0.15s ease;
    opacity: 0.3;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
}

.bar-fill.active {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bar-fill:hover {
    transform: scaleY(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bar-fill.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1s infinite;
}

.bar-fill.highlighted {
    opacity: 1 !important;
    transform: scaleY(1.2);
    z-index: 10;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Faster shimmer animation for better performance */
.bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scaleY(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% {
        transform: scaleY(1.15);
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
    }
}

/* Subdomains Section */
.subdomains {
    padding: 5rem 0;
}

.subdomains-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.subdomain-card {
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-rows: auto 1fr auto;
    gap: 0.75rem;
    min-height: 130px;
}

.subdomain-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 16px 16px 0 0;
}

.subdomain-card:hover::before {
    transform: scaleX(1);
}

.subdomain-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #e2e8f0;
}

.subdomain-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    grid-column: 1;
    grid-row: 1;
}

.subdomain-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4ade80, #22d3ee);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
    transition: transform 0.3s ease;
}

.subdomain-icon:hover {
    transform: scale(1.05);
}

.subdomain-info {
    flex: 1;
}

.subdomain-info h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subdomain-info h3::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.subdomain-letter {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    margin-right: 8px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.subdomain-description {
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    grid-column: 1;
    grid-row: 2;
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-container {
    margin: 0;
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 190px;
}

.video-placeholder:hover {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.video-placeholder i {
    font-size: 32px;
    color: #64748b;
    margin-bottom: 6px;
    display: block;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.video-placeholder:hover i {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.video-placeholder span {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 160px;
}

.subdomain-dimensions {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0;
    grid-column: 1;
    grid-row: 3;
    align-self: start;
}

.dimension-tag {
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1.1;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.dimension-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dimension-tag.sensory { 
    background: linear-gradient(135deg, #ff6b6b, #ff8a8a);
    color: #ffffff;
    border-color: #ff5252;
}
.dimension-tag.cognitive { 
    background: linear-gradient(135deg, #4dabf7, #74c0fc);
    color: #ffffff;
    border-color: #339af0;
}
.dimension-tag.emotional { 
    background: linear-gradient(135deg, #ffd43b, #ffec8c);
    color: #856404;
    border-color: #fab005;
}
.dimension-tag.social { 
    background: linear-gradient(135deg, #51cf66, #8ce99a);
    color: #ffffff;
    border-color: #40c057;
}
.dimension-tag.spiritual { 
    background: linear-gradient(135deg, #9775fa, #b197fc);
    color: #ffffff;
    border-color: #845ef7;
}
.dimension-tag.physical { 
    background: linear-gradient(135deg, #e03131, #ff6b6b);
    color: #ffffff;
    border-color: #c92a2a;
}

/* Domain Navigation */
.domain-navigation {
    padding: 80px 0;
    background: white;
}

.nav-domains {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.nav-domain-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #334155;
    transition: all 0.15s ease;
}

.nav-domain-card:hover {
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.nav-domain-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: white;
}

/* Modal Styles - Cross Browser Compatible */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    
    /* Flexbox with all prefixes for maximum compatibility */
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.modal-content {
    background: transparent;
    padding: 0;
    border-radius: 12px;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    width: 90%;
    max-width: 900px;
    height: auto;
    max-height: 85vh;
    aspect-ratio: 16 / 9;
    position: relative;
    margin: 0;
    overflow: hidden;
    -webkit-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#videoModal .modal-content {
    background: #000;
    padding: 0;
}

#dimensionModal .modal-content {
    background: #ffffff;
    width: min(92vw, 760px);
    max-height: 85vh;
    aspect-ratio: auto;
    overflow-y: auto;
    padding: 1.25rem;
}

.modal-video {
    width: 100%;
    height: 100%;
}

#videoModal iframe,
.modal-video iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

