/* PopupInfo & Modals CSS */
:root {
    --modal-bg: rgba(10, 10, 10, 0.85);
    --modal-content-bg: #1e1e1e;
    --modal-border: rgba(255, 255, 255, 0.08);
    --modal-text: #e0e0e0;

    /* Colors */
    --brand-red: #a81717;
    /* Kostrzewa Dark Red */
    --deco-red: #e93131;
    /* Bright Decorative Red */
    --link-color: #338bdd;
    /* Blue Links */
    --link-hover-color: #5aaaff;
    --heading-color: #ffffff;
    --muted-text: #a0a0a0;
}

/* Overlay tła */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10001;
    /* Higher than Lead Widget (9999) */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Kontener modala */
.modal-container {
    background: var(--modal-content-bg);
    width: 90%;
    max-width: 900px;
    height: 85vh;
    border-radius: 16px;
    border: 1px solid var(--modal-border);
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.is-open .modal-container {
    transform: scale(1) translateY(0);
}

/* Nagłówek Modala (Pasek z X) */
.modal-header {
    padding: 16px 30px;
    border-bottom: 1px solid var(--modal-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.modal-title-bar {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Przycisk zamknięcia */
.modal-close {
    background: transparent;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

/* Treść */
.modal-body {
    padding: 0;
    overflow-y: auto;
    color: var(--modal-text);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    font-weight: 300;
    flex-grow: 1;
    font-size: 15px;
}

/* Scrollbar */
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
    border: 2px solid #1a1a1a;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Stopka modala */
.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--modal-border);
    text-align: right;
    background: #1a1a1a;
    flex-shrink: 0;
}

.btn-modal-close {
    background: transparent;
    color: #fff;
    border: 1px solid var(--deco-red);
    padding: 10px 28px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: 0.5px;
}

.btn-modal-close:hover {
    background: var(--deco-red);
    box-shadow: 0 4px 15px rgba(233, 49, 49, 0.3);
    border-color: var(--deco-red);
    transform: translateY(-1px);
}

/* --- Content Specific Styling --- */

/* Wrapper */
.popupinfo-content-wrapper {
    padding: 40px 50px;
    background: linear-gradient(to bottom, #1e1e1e, #1a1a1a);
    color: var(--modal-text);
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .popupinfo-content-wrapper {
        padding: 24px;
    }

    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        padding: 12px 20px;
    }
}

/* Typography Reset & Styling */

/* Main Header */
.popupinfo-content-wrapper h1.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--heading-color);
    line-height: 1.2;
    text-align: left !important;
    border-left: 4px solid var(--deco-red);
    padding-left: 16px;
}

/* Sub-lead / Intro text */
.popupinfo-content-wrapper h2.subtitle {
    font-size: 1.05rem;
    font-weight: 400;
    color: #cccccc;
    margin-bottom: 40px;
    line-height: 1.6;
    text-align: left !important;
}

/* Section Headers */
.popupinfo-content-wrapper h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--heading-color);
    margin-top: 40px;
    margin-bottom: 20px;
    line-height: 1.4;
    border-left: 3px solid var(--deco-red);
    /* Czerwony akcent */
    padding-left: 12px;
}

/* Paragraphs */
.popupinfo-content-wrapper p {
    margin-bottom: 1.25rem;
    color: #d0d0d0;
}

.popupinfo-content-wrapper strong {
    font-weight: 700;
    color: #ffffff;
}

/* Ordered Lists (Numerowane: 1, 2, 3...) */
.popupinfo-content-wrapper ol {
    counter-reset: item;
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 2rem;
}

.popupinfo-content-wrapper ol>li {
    display: block;
    padding-left: 2.5em;
    position: relative;
    margin-bottom: 1rem;
    color: #d0d0d0;
}

.popupinfo-content-wrapper ol>li::before {
    content: counter(item) ".";
    counter-increment: item;
    position: absolute;
    left: 0;
    top: 0;
    color: var(--deco-red);
    /* Czerwony numer */
    font-weight: 700;
    font-size: 1em;
}

/* Sub-lists (Nested letters: a, b, c...) */
.popupinfo-content-wrapper ol>li>ol {
    counter-reset: subitem;
    margin-top: 10px;
    margin-bottom: 0;
}

.popupinfo-content-wrapper ol>li>ol>li {
    padding-left: 2em;
}

.popupinfo-content-wrapper ol>li>ol>li::before {
    content: counter(subitem, lower-alpha) ")";
    counter-increment: subitem;
    color: var(--deco-red);
    /* Czerwona litera */
    font-weight: 700;
    /* Pogrubione dla "ładnego wystylowania" */
    font-size: 1em;
    left: 0.2em;
}

/* Unordered Lists (Kropki) */
.popupinfo-content-wrapper ul {
    list-style-type: none;
    padding-left: 20px;
    margin-bottom: 2rem;
}

.popupinfo-content-wrapper ul li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 8px;
    color: #d0d0d0;
}

.popupinfo-content-wrapper ul li::before {
    content: "•";
    color: var(--deco-red);
    /* Czerwona kropka */
    font-weight: bold;
    font-size: 1.4em;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    vertical-align: middle;
    line-height: 1;
}

/* Links (pozostają niebieskie) */
.popupinfo-content-wrapper a {
    color: var(--link-color);
    /* #338bdd */
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(51, 139, 221, 0.3);
    transition: all 0.2s ease;
}

.popupinfo-content-wrapper a:hover {
    color: var(--link-hover-color);
    border-bottom-color: var(--link-hover-color);
}

/* Reset helpers */
.popupinfo-content-wrapper .section,
.popupinfo-content-wrapper .container {
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
}