/* Theory Page Specific Styles */

.theory-hero {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.theory-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
            circle at 20% 80%,
            rgba(255, 255, 255, 0.3) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(255, 255, 255, 0.3) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 40% 40%,
            rgba(255, 255, 255, 0.2) 0%,
            transparent 50%
        );
    animation: shimmer 15s ease-in-out infinite;
}

.theory-hero::after {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: drift 20s linear infinite;
    transition: transform 0.3s ease-out;
}

.theory-hero.mouse-active::after {
    transform: translate(
        calc((var(--mouse-x) - 50%) * 0.1),
        calc((var(--mouse-y) - 50%) * 0.1)
    );
}

@keyframes shimmer {
    0%,
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1) rotate(1deg);
    }
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(100px, 100px);
    }
}

.theory-hero h1 {
    font-family: 'Raleway', sans-serif;
    font-size: 1.9rem;
    font-weight: 200;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

.theory-hero .hero-subtitle {
    font-family: 'Raleway', sans-serif;
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Loop detail styles */
.loop-detail {
    transition: transform 0.2s, box-shadow 0.2s;
}

.loop-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Button hover states */
.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(8, 145, 178, 0.3) !important;
}

.btn-secondary:hover {
    background: #0891b2 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(8, 145, 178, 0.2);
}

/* Table hover effects */
.intervention-box table tr:hover td {
    background: #f0f9ff !important;
}

/* Toggle button hover */
.toggle-btn:hover {
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
}

.loop-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.loop-number {
    background: var(--primary-color);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.intervention-box {
    background: #f0fdf4;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.intervention-box h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.evidence-list {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.flow-diagram {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
}

.loop-detail {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.loop-detail h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loop-detail ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.loop-detail li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Section content styling */
.section-content {
    animation: fadeIn 0.3s ease-in-out;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Section headers to match index page styling */
.section-content h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.section-content h4 {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
}

/* Ensure paragraphs and other text use Inter */
.section-content p,
.section-content li,
.section-content td,
.section-content span {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip styles - required for HTMX-loaded content */
.tooltip {
    position: relative;
    border-bottom: 1px dotted #0891b2;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    margin-bottom: 5px;
    z-index: 1000;
    max-width: 300px;
    white-space: normal;
    text-align: left;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
}

.tooltip:hover::after {
    transform: translateX(-50%) translateY(-3px);
}