/* =========================================
   WRAPPER & SYSTEM STYLES (Gold Standard)
   ========================================= */
.ioa-guide-s-tier {
    position: relative;
    width: 100%;
}

.ioa-guide-s-tier *,
.ioa-guide-s-tier *::before,
.ioa-guide-s-tier *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================================
   TELEPORT SLOTS (Gold Standard Feature)
   ========================================= */
.ioa-teleport-slot {
    min-height: 0;
    transition: all 0.3s ease;
    margin-bottom: 0;
    width: 100%;
}

.ioa-teleport-slot.has-content {
    margin-bottom: 2rem;
    animation: ioa-fade-in 0.5s ease;
}

/* Editor Visuals - Visible only in Elementor Editor (.is-editor-mode added via PHP) */
.is-editor-mode .ioa-teleport-slot {
    min-height: 40px;
    border: 1px dashed rgba(30, 58, 138, 0.4);
    background: rgba(30, 58, 138, 0.05);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.is-editor-mode .ioa-teleport-slot::before {
    content: attr(data-label);
    font-size: 11px;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@keyframes ioa-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   CORE CONTAINER STYLES
   ========================================= */
.ioa-guide-container {
    /* Core Palette */
    --color-primary: #1e3a8a;
    --color-primary-dark: #1e40af;
    --color-primary-light: rgba(30, 58, 138, 0.08);
    --color-primary-ultra-light: rgba(30, 58, 138, 0.03);
    --color-surface: #ffffff;
    --color-surface-alt: #f3f4f6;
    --color-background: #f9fafb;
    --color-border: #e5e7eb;
    --color-text-primary: #111827;
    --color-text-secondary: #374151;
    --color-text-tertiary: #6b7280;
    --color-text-on-dark: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    /* Spacing */
    --space-2xs: 0.5rem;   
    --space-xs: 0.75rem;   
    --space-sm: 1rem;      
    --space-md: 1.5rem;    
    --space-lg: 2rem;      
    --space-xl: 2.5rem;    
    --space-2xl: 3.5rem;   
    --space-3xl: 5rem;     

    /* Border Radius */
    --radius-md: 0.5rem;   
    --radius-lg: 0.75rem;  
    --radius-full: 9999px;
    
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--color-text-secondary);
    letter-spacing: 0.01em;
    width: 100%;
    /* Default padding fallback */
    padding: var(--space-2xl) var(--space-md) var(--space-3xl);
    position: relative;
    background-color: var(--color-background);
    overflow-x: hidden;
}

/* BOXED LAYOUT (Standard/Centered) */
.ioa-guide-container.ioa-layout-boxed {
    max-width: 1280px; 
    margin-left: auto;
    margin-right: auto;
}

/* FLUID LAYOUT (Full Width/Custom) */
.ioa-guide-container.ioa-layout-fluid {
    max-width: 100%;
}

/* Decorative Backgrounds */
.ioa-guide-bg-decorations {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.ioa-guide-molecules-pattern {
    position: absolute; top: 5%; right: -5%;
    width: 300px; height: 300px; opacity: 0.3; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'%3E%3Ccircle cx='10' cy='10' r='2' fill='%231e3a8a' fill-opacity='0.5'/%3E%3Ccircle cx='30' cy='5' r='1' fill='%231e3a8a' fill-opacity='0.3'/%3E%3Ccircle cx='5' cy='35' r='1.5' fill='%231e3a8a' fill-opacity='0.4'/%3E%3Ccircle cx='40' cy='40' r='2.5' fill='%231e3a8a' fill-opacity='0.6'/%3E%3C/svg%3E");
    background-size: 100px 100px; 
}
.ioa-guide-dot-pattern {
    position: absolute; bottom: 10%; left: 5%;
    width: 200px; height: 200px; opacity: 0.2; 
    background-image: radial-gradient(var(--color-primary-light) 1px, transparent 1.5px); 
    background-size: 16px 16px; border-radius: 50%;
}

/* --- TYPOGRAPHY --- */
.ioa-guide-container h2, .ioa-guide-organization-name {
    font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--color-text-primary);
    line-height: 1.2; letter-spacing: -0.02em;
}
.ioa-guide-container h2 { font-size: 1.875rem; margin-bottom: var(--space-sm); }
.ioa-guide-organization-name { font-size: 1.25rem; margin-bottom: var(--space-2xs); }
.ioa-guide-category-description p { font-size: 18px; margin-bottom: 0; }
.ioa-guide-intro-card > p { font-size: 16px; line-height: 1.6; }
.ioa-guide-organization-country, .ioa-guide-letter-link, .ioa-guide-organization-link { font-size: 15px; }
.ioa-guide-intro-badge, .ioa-guide-alphabet-title, .ioa-guide-stats-label { font-size: 12px; }

/* Introduction Card */
.ioa-guide-intro-card { 
    background-color: var(--color-surface); border-radius: var(--radius-md); 
    padding: var(--space-lg); margin-bottom: var(--space-2xl); 
    box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); 
    position: relative; overflow: hidden; z-index: 1;
}
.ioa-guide-intro-badge { 
    display: inline-block; padding: var(--space-2xs) var(--space-sm); 
    background-color: var(--color-primary-light); color: var(--color-primary);
    border-radius: var(--radius-full); font-weight: 500; margin-bottom: var(--space-md); 
}
.ioa-guide-category { margin-bottom: var(--space-lg); }
.ioa-guide-category:last-of-type { margin-bottom: 0; }
.ioa-guide-category-title { display: flex; align-items: center; margin-bottom: var(--space-sm); }
.ioa-guide-category-icon { width: 24px; height: 24px; margin-right: var(--space-xs); fill: var(--color-primary); flex-shrink: 0; }
.ioa-guide-category-icon svg { width: 100%; height: 100%; }
.ioa-guide-category-description { padding-left: calc(24px + var(--space-sm)); color: var(--color-text-secondary); position: relative; }
.ioa-guide-category-description::before { 
    content: ""; position: absolute; left: 0; top: var(--space-xs); bottom: var(--space-xs); width: 2px;
    background-color: var(--color-primary-light); border-radius: var(--radius-full);
}

/* Alphabet Navigation */
.ioa-guide-alphabet-nav {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: var(--space-2xs); margin: var(--space-xl) 0; padding: var(--space-sm) var(--space-md); 
    background-color: var(--color-surface-alt); border-radius: var(--radius-md); 
    border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); 
    position: relative; z-index: 1;
}
.ioa-guide-alphabet-title { font-weight: 500; color: var(--color-text-secondary); margin-right: var(--space-sm); }
.ioa-guide-letter-link { 
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-full); 
    font-family: 'Poppins', sans-serif; font-weight: 500; color: var(--color-text-secondary);
    text-decoration: none; background-color: transparent; border: 1px solid transparent; 
    transition: all 0.2s ease;
    cursor: pointer;
}
.ioa-guide-letter-link:not(.disabled):hover {
    color: var(--color-primary); background-color: var(--color-primary-ultra-light); transform: translateY(-3px);
}
.ioa-guide-letter-link.active {
    background-color: var(--color-primary); color: var(--color-text-on-dark);
    font-weight: 600; border-color: var(--color-primary-dark);
}
.ioa-guide-letter-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Letter Separator */
.ioa-guide-letter-separator {
    width: 100%; display: flex; align-items: center; position: relative;
    margin: var(--space-xl) 0 var(--space-lg); padding: var(--space-sm) 0;
}
.ioa-guide-letter-badge { 
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background-color: var(--color-primary); color: var(--color-text-on-dark);
    font-family: 'Poppins', sans-serif; font-size: 1.875rem; font-weight: 600;
    border-radius: var(--radius-md); box-shadow: var(--shadow-md); flex-shrink: 0;
}
.ioa-guide-letter-line { flex: 1; height: 1px; margin-left: var(--space-md); background: var(--color-border); }

/* Organization Grid & Cards */
.ioa-guide-organizations-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg); margin-bottom: var(--space-2xl); 
}
.ioa-guide-organization-card { 
    padding: var(--space-lg); background-color: var(--color-surface); 
    border-radius: var(--radius-md); border: 1px solid var(--color-border); 
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ioa-guide-organization-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}
.ioa-guide-organization-country { font-weight: 400; color: var(--color-text-tertiary); margin-bottom: var(--space-sm); }
.ioa-guide-organization-link { 
    display: inline-flex; align-items: center; color: var(--color-primary);
    text-decoration: none; font-weight: 500; transition: all 0.2s ease;
}
.ioa-guide-organization-link:hover { color: var(--color-primary-dark); gap: 5px; }
.ioa-guide-organization-icon { width: 16px; height: 16px; margin-right: var(--space-2xs); fill: currentColor; }

/* Back to Top Button */
.ioa-guide-back-top { 
    position: fixed; bottom: var(--space-lg); right: var(--space-lg);
    width: 44px; height: 44px; border-radius: 50%; background-color: var(--color-primary);
    color: var(--color-text-on-dark); display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md); cursor: pointer; opacity: 0; transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    z-index: 100; border: none;
}
.ioa-guide-back-top.visible { opacity: 1; transform: translateY(0); }
.ioa-guide-back-top:hover { background-color: var(--color-primary-dark); transform: translateY(-3px); }
.ioa-guide-back-icon { width: 20px; height: 20px; fill: currentColor; }

/* Statistics Badge */
.ioa-guide-stats-badge { 
    position: absolute; top: var(--space-lg); right: var(--space-lg); 
    background-color: var(--color-surface); border-radius: var(--radius-md);
    padding: var(--space-md); box-shadow: var(--shadow-md); border: 1px solid var(--color-border);
    display: flex; flex-direction: column; align-items: center; text-align: center; z-index: 5; 
}
.ioa-guide-stats-icon { width: 32px; height: 32px; fill: var(--color-primary); margin-bottom: var(--space-2xs); }
.ioa-guide-stats-icon svg { width: 100%; height: 100%; }
.ioa-guide-stats-number { 
    font-family: 'Poppins', sans-serif; font-size: 1.875rem; font-weight: 600;
    color: var(--color-primary); line-height: 1;
}
.ioa-guide-stats-label { font-weight: 500; color: var(--color-text-secondary); margin-top: 2px; }

/* Utility & State Classes */
.ioa-guide-letter-section { display: none; }
.ioa-guide-letter-section.active { display: block; animation: ioa-fade-in 0.5s ease; }
.ioa-guide-loading { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; }
.ioa-guide-loading.active { display: flex; }
.ioa-guide-loading-spinner { width: 36px; height: 36px; border: 3px solid var(--color-primary-light); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Responsive styles */
@media (max-width: 1100px) { 
    .ioa-guide-stats-badge { position: relative; top: auto; right: auto; transform: none !important; margin: 0 auto var(--space-lg); max-width: 180px; }
}
@media (max-width: 768px) { 
    .ioa-guide-container { padding: var(--space-xl) var(--space-sm) var(--space-2xl); }
    .ioa-guide-organizations-grid { grid-template-columns: 1fr; }
    .ioa-guide-alphabet-nav { padding: var(--space-xs); gap: var(--space-2xs); }
    .ioa-guide-letter-link { width: 28px; height: 28px; }
    .ioa-guide-dot-pattern, .ioa-guide-molecules-pattern, .ioa-guide-stats-badge { display: none; }
    .ioa-guide-intro-card { padding: var(--space-md); }
}
@media (max-width: 480px) { 
    .ioa-guide-alphabet-title { width: 100%; text-align: center; margin-bottom: var(--space-xs); margin-right: 0; }
    .ioa-guide-letter-link { width: 26px; height: 26px; font-size: 12px; }
    .ioa-guide-letter-badge { width: 36px; height: 36px; font-size: 1.5rem; }
    .ioa-guide-organization-card { padding: var(--space-md); }
    .ioa-guide-back-top { width: 40px; height: 40px; bottom: var(--space-md); right: var(--space-md); }
    .ioa-guide-back-icon { width: 18px; height: 18px; }
}