/* =================================================================
   FOIL PYRAMID MODAL COMPONENT
   Educational modal showing substrate compatibility tiers for sleeking foil
   ================================================================= */

/* Brand fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Custom Properties */
:root {
    --pyramid-modal-bg: rgba(2, 38, 98, 0.95);
    --pyramid-accent: #f68b1f;
    --pyramid-text: #ffffff;
    --pyramid-text-muted: rgba(255, 255, 255, 0.7);
    --pyramid-tier-1: #d4af37;  /* Gold */
    --pyramid-tier-2: #c0c0c0;  /* Silver */
    --pyramid-tier-3: #b87333;  /* Copper/Bronze */
    --pyramid-tier-4: #8b4513;  /* Sienna */
    --pyramid-benefit: #4caf50;
    --pyramid-limitation: #ff9800;
    --pyramid-panel-bg: rgba(255, 255, 255, 0.08);
}

/* =================================================================
   TRIGGER CARD
   ================================================================= */

.pyramid-card {
    max-width: 320px;
    margin: 24px 0;
}

.pyramid-card__trigger {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.pyramid-card__trigger:hover {
    background: #fff;
    border-color: var(--pyramid-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(246, 139, 31, 0.15);
}

.pyramid-card__thumbnail {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #022662 0%, #033a8c 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.pyramid-card__thumbnail svg {
    width: 40px;
    height: 40px;
}

.pyramid-card__info {
    flex: 1;
    min-width: 0;
}

.pyramid-card__label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pyramid-accent);
    margin-bottom: 4px;
}

.pyramid-card__title {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #022662;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.pyramid-card__hint {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #666;
}

.pyramid-card__trigger:hover .pyramid-card__hint {
    color: var(--pyramid-accent);
}

/* Text-wrap floating styles (for use in content sections) */
.pyramid-card--float-left {
    float: left;
    margin: 0 20px 15px 0;
    clear: left;
    max-width: 240px;
}

.pyramid-card--float-right {
    float: right;
    margin: 0 0 15px 20px;
    clear: right;
    max-width: 240px;
}

@media (max-width: 600px) {
    .pyramid-card--float-left,
    .pyramid-card--float-right {
        float: none;
        margin: 20px auto;
        max-width: 100%;
    }
}

/* Inline link trigger alternative */
.pyramid-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: inherit;
    color: var(--pyramid-accent);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.pyramid-link:hover {
    color: #022662;
}

.pyramid-link__icon {
    font-size: 0.8em;
}

/* =================================================================
   MODAL CONTAINER
   ================================================================= */

.pyramid-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pyramid-modal.active {
    display: flex;
}

.pyramid-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--pyramid-modal-bg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pyramid-modal.active .pyramid-modal__backdrop {
    opacity: 1;
}

.pyramid-modal__content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pyramid-modal.active .pyramid-modal__content {
    transform: scale(1);
    opacity: 1;
}

.pyramid-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pyramid-modal__close:hover {
    background: var(--pyramid-accent);
    color: #fff;
}

/* =================================================================
   MODAL HEADER
   ================================================================= */

.pyramid-modal__header {
    padding: 32px 60px 24px 32px;
    background: linear-gradient(135deg, #022662 0%, #033a8c 100%);
    color: #fff;
}

.pyramid-modal__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: #fff;
}

.pyramid-modal__subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* =================================================================
   MODAL BODY - TWO COLUMN LAYOUT
   ================================================================= */

.pyramid-modal__body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

/* =================================================================
   PYRAMID VISUALIZATION (LEFT SIDE)
   ================================================================= */

.pyramid-modal__visualization {
    background: #f5f7fa;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e8eaed;
}

.pyramid-visual {
    width: 100%;
    max-width: 220px;
}

.pyramid-visual svg {
    width: 100%;
    height: auto;
}

/* Pyramid tier segments */
.pyramid-visual__tier {
    cursor: pointer;
    transition: all 0.3s ease;
}

.pyramid-visual__tier:hover {
    filter: brightness(1.1);
}

.pyramid-visual__tier.active {
    filter: drop-shadow(0 0 8px currentColor);
}

/* Tier fill colors */
.pyramid-visual__tier--1 { fill: var(--pyramid-tier-1); }
.pyramid-visual__tier--2 { fill: var(--pyramid-tier-2); }
.pyramid-visual__tier--3 { fill: var(--pyramid-tier-3); }
.pyramid-visual__tier--4 { fill: var(--pyramid-tier-4); }

/* Active tier glow */
.pyramid-visual__tier--1.active { filter: drop-shadow(0 0 12px var(--pyramid-tier-1)); }
.pyramid-visual__tier--2.active { filter: drop-shadow(0 0 12px var(--pyramid-tier-2)); }
.pyramid-visual__tier--3.active { filter: drop-shadow(0 0 12px var(--pyramid-tier-3)); }
.pyramid-visual__tier--4.active { filter: drop-shadow(0 0 12px var(--pyramid-tier-4)); }

.pyramid-visual__label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    fill: #fff;
    pointer-events: none;
    text-anchor: middle;
}

.pyramid-visual__tier--4 .pyramid-visual__label {
    fill: #fff;
}

/* Tier legend below pyramid */
.pyramid-legend {
    margin-top: 24px;
    width: 100%;
}

.pyramid-legend__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: color 0.2s ease;
}

.pyramid-legend__item:hover {
    color: #022662;
}

.pyramid-legend__item.active {
    font-weight: 600;
    color: #022662;
}

.pyramid-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.pyramid-legend__dot--1 { background: var(--pyramid-tier-1); }
.pyramid-legend__dot--2 { background: var(--pyramid-tier-2); }
.pyramid-legend__dot--3 { background: var(--pyramid-tier-3); }
.pyramid-legend__dot--4 { background: var(--pyramid-tier-4); }

/* =================================================================
   DETAIL PANEL (RIGHT SIDE)
   ================================================================= */

.pyramid-modal__detail {
    padding: 32px;
    overflow-y: auto;
}

.pyramid-detail {
    display: none;
}

.pyramid-detail.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tier badge */
.pyramid-detail__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.pyramid-detail__badge--1 {
    background: linear-gradient(135deg, var(--pyramid-tier-1), #b8962e);
    color: #1a1a1a;
}

.pyramid-detail__badge--2 {
    background: linear-gradient(135deg, var(--pyramid-tier-2), #a8a8a8);
    color: #1a1a1a;
}

.pyramid-detail__badge--3 {
    background: linear-gradient(135deg, var(--pyramid-tier-3), #9a6329);
    color: #fff;
}

.pyramid-detail__badge--4 {
    background: linear-gradient(135deg, var(--pyramid-tier-4), #6b3410);
    color: #fff;
}

.pyramid-detail__badge-icon {
    width: 16px;
    height: 16px;
}

/* Tier name */
.pyramid-detail__name {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #022662;
    margin: 0 0 8px 0;
}

/* Substrate description */
.pyramid-detail__substrate {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    margin-bottom: 16px;
}

/* Ink requirement */
.pyramid-detail__ink-requirement {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f0f2f5;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #555;
    margin-bottom: 24px;
}

.pyramid-detail__ink-requirement svg {
    width: 16px;
    height: 16px;
    color: #888;
}

/* Content sections */
.pyramid-detail__section {
    margin-bottom: 20px;
}

.pyramid-detail__section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin: 0 0 12px 0;
}

/* List items */
.pyramid-detail__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pyramid-detail__list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.pyramid-detail__list-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.pyramid-detail__list-item--benefit svg {
    color: var(--pyramid-benefit);
}

.pyramid-detail__list-item--limitation svg {
    color: var(--pyramid-limitation);
}

/* Expectation callout */
.pyramid-detail__expectation {
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #e7f0fb 0%, #f0f5fc 100%);
    border-left: 4px solid #022662;
    border-radius: 0 8px 8px 0;
}

.pyramid-detail__expectation-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #022662;
    margin-bottom: 6px;
}

.pyramid-detail__expectation-text {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    margin: 0;
}

/* Page indicator */
.pyramid-detail__page-indicator {
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(246, 139, 31, 0.1);
    border: 1px solid rgba(246, 139, 31, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pyramid-detail__page-indicator svg {
    width: 18px;
    height: 18px;
    color: var(--pyramid-accent);
}

.pyramid-detail__page-indicator-text {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #555;
}

.pyramid-detail__page-indicator-text strong {
    color: var(--pyramid-accent);
    font-weight: 600;
}

/* =================================================================
   MODAL NAVIGATION
   ================================================================= */

.pyramid-modal__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 32px;
    background: #f5f7fa;
    border-top: 1px solid #e8eaed;
}

.pyramid-modal__tier-dots {
    display: flex;
    gap: 8px;
}

.pyramid-modal__tier-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pyramid-modal__tier-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.pyramid-modal__tier-dot.active {
    background: var(--pyramid-accent);
    transform: scale(1.3);
}

.pyramid-modal__tier-counter {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #666;
    min-width: 80px;
    text-align: center;
}

.pyramid-modal__nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pyramid-modal__nav-btn:hover:not(:disabled) {
    background: var(--pyramid-accent);
    border-color: var(--pyramid-accent);
    color: #fff;
}

.pyramid-modal__nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pyramid-modal__nav-btn svg {
    width: 18px;
    height: 18px;
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

/* Tablet - Stack layout */
@media (max-width: 768px) {
    .pyramid-modal {
        padding: 0;
    }

    .pyramid-modal__content {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .pyramid-modal__header {
        padding: 20px 50px 16px 20px;
    }

    .pyramid-modal__title {
        font-size: 22px;
    }

    .pyramid-modal__subtitle {
        font-size: 13px;
    }

    .pyramid-modal__body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .pyramid-modal__visualization {
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #e8eaed;
    }

    .pyramid-visual {
        max-width: 160px;
    }

    .pyramid-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        margin-top: 16px;
    }

    .pyramid-legend__item {
        padding: 4px 0;
    }

    .pyramid-modal__detail {
        padding: 20px;
    }

    .pyramid-detail__name {
        font-size: 20px;
    }

    .pyramid-modal__nav {
        padding: 16px 20px;
    }
}

/* Mobile - Compact */
@media (max-width: 480px) {
    .pyramid-card__trigger {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pyramid-card__thumbnail {
        width: 100%;
        height: 80px;
    }

    .pyramid-modal__close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .pyramid-modal__header {
        padding: 16px 44px 14px 16px;
    }

    .pyramid-modal__title {
        font-size: 18px;
    }

    .pyramid-modal__visualization {
        padding: 16px;
    }

    .pyramid-visual {
        max-width: 140px;
    }

    .pyramid-modal__detail {
        padding: 16px;
    }

    .pyramid-detail__badge {
        font-size: 11px;
        padding: 5px 10px;
    }

    .pyramid-detail__name {
        font-size: 18px;
    }

    .pyramid-detail__substrate {
        font-size: 14px;
    }

    .pyramid-detail__list-item {
        font-size: 13px;
    }

    .pyramid-modal__nav {
        padding: 12px 16px;
        gap: 12px;
    }

    .pyramid-modal__tier-counter {
        font-size: 12px;
        min-width: 70px;
    }

    .pyramid-modal__nav-btn {
        width: 32px;
        height: 32px;
    }
}
