/*
 * aTheme - Vertical Tabs (Pigułki + Float Card)
 */

.ath-tabs-vertical {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.ath-tabs-nav-col {
    width: 100%;
}

.ath-tabs-content-col {
    width: 100%;
}

@media screen and (min-width: 768px) {
    .ath-tabs-vertical {
        flex-direction: row;
        align-items: flex-start;
        gap: 40px;
    }
    
    .ath-tabs-nav-col {
        flex: 0 0 calc(25% - 20px);
        width: calc(25% - 20px);
        position: sticky;
        top: calc(var(--ath-topbar-height, 0px) + 120px);
        align-self: flex-start;
    }
    
    .ath-tabs-content-col {
        flex: 0 0 calc(75% - 20px);
        width: calc(75% - 20px);
    }
}

/* 
 * NAWIGACJA (Lewa Kolumna) - PIGUŁKI
 */
.ath-tabs-nav {
    list-style: none !important;
    margin: 0;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Dla mniejszych ekranów nawigacja traci pozycję sticky */
@media screen and (max-width: 767px) {
    .ath-tabs-nav {
        position: static;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        margin-bottom: 30px;
    }
}

.ath-tabs-nav li {
    margin-bottom: 0 !important;
}

.ath-tabs-nav a,
.ath-tab-link {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ath-secondary-color, #1e293b);
    transition: all 0.3s ease;
    background: #ffffff;
    border-radius: 50px;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.03);
    text-decoration: none;
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
}

.ath-tab-icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    fill: currentColor;
}

/* Stan Aktywny (Pigułki) */
.ath-tabs-nav a.active,
.ath-tab-link.active {
    background: var(--ath-secondary-color, #1e293b);
    color: #ffffff;
    box-shadow: 0px 10px 20px rgba(0,0,0,0.1);
    border-color: transparent;
}

/* Stan Hover dla nieaktywnych pigułek */
.ath-tabs-nav a:not(.active):hover,
.ath-tab-link:not(.active):hover {
    background: color-mix(in srgb, var(--ath-secondary-color, #1e293b) 4%, #ffffff);
    box-shadow: 0px 6px 18px rgba(0,0,0,0.04);
}

.ath-tabs-nav a.active .ath-tab-icon,
.ath-tab-link.active .ath-tab-icon {
    /* Używamy maski CSS, aby pomalować wektorowe logo (wstrzyknięte jako img base64) kolorem akcentu */
    filter: invert(56%) sepia(91%) saturate(2321%) hue-rotate(164deg) brightness(97%) contrast(98%);
    /* W CSS nie da się prosto zmienić koloru <img src="data:..."> bez maski lub filtru, ale
       jeśli ikona dodana to możemy użyć bezpieczniejszego trybu */
}

/* Pseudo-element dla strzałki w prawo (Chevron) w stanie aktywnym */
.ath-tabs-nav a::after,
.ath-tab-link::after {
    content: '';
    display: block;
    width: 8px;
    height: 14px;
    background-color: var(--ath-accent-color, #0ea5e9);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/></svg>');
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-position: center;
    -webkit-mask-position: center;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    position: absolute;
    right: 25px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.ath-tabs-nav a.active::after,
.ath-tab-link.active::after {
    opacity: 1;
    transform: translateX(0);
}

@media screen and (max-width: 767px) {
    .ath-tabs-nav {
        flex-direction: row;
        gap: 10px;
    }
    .ath-tabs-nav a,
    .ath-tab-link {
        flex: 1 1 auto;
        justify-content: center;
        padding: 15px 20px;
        text-align: center;
    }
    .ath-tabs-nav a::after,
    .ath-tab-link::after {
        display: none;
    }
}

/* 
 * KONTENT ZAKŁADEK (Prawa Kolumna 70%)
 */
.ath-tabs-content {
    flex-grow: 1;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0px 10px 40px rgba(0,0,0,0.04);
}

@media screen and (max-width: 767px) {
    .ath-tabs-content {
        padding: 30px 20px;
    }
}

.ath-tab-pane {
    display: none;
    animation: athTabFadeIn 0.4s ease forwards;
}

.ath-tab-pane.active {
    display: block;
}

.ath-tabs-content .ath-tab-pane > :first-child {
    margin-top: 0 !important;
}

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

/* 
 * LISTY KONTENTU (Check-marki)
 */
.ath-tabs-content ul.wp-block-list {
    list-style: none !important;
    padding-left: 0;
    margin-top: 30px;
}

.ath-tabs-content ul.wp-block-list > li {
    position: relative;
    padding-left: 45px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.ath-tabs-content ul.wp-block-list > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    /* Obwódka i środek wg designu - turkusowa checkmarka */
    background-color: var(--ath-accent-color, #0ea5e9);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>');
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    opacity: 0.9;
}

/* W edytorze Gutenberg chcemy widzieć wszystkie zakładki jedna pod drugą, aby ułatwić edycję */
.editor-styles-wrapper .ath-tab-pane {
    display: block;
    margin-bottom: 40px;
    border: 1px dashed #cbd5e1;
    padding: 20px;
    border-radius: var(--ath-border-radius-card, 8px);
}
.editor-styles-wrapper .ath-tab-pane::before {
    content: "Zakładka ID: " attr(id);
    display: block;
    font-size: 11px;
    color: #64748b;
    font-family: monospace;
    margin-bottom: 15px;
    background: #f8fafc;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    width: max-content;
}

