/* Custom styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0e14;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background-color: transparent;
    pointer-events: none;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.hero-content {
    position: relative;
    pointer-events: auto;
}

.hero-title {
    text-shadow: 0 0 15px rgba(0, 194, 203, 0.4), 0 0 30px rgba(0, 194, 203, 0.2);
}

.glow-button {
    box-shadow: 0 0 5px #00c2cb, 0 0 15px #00c2cb, 0 0 25px #00c2cb;
    transition: all 0.3s ease-in-out;
}

.glow-button:hover {
    box-shadow: 0 0 10px #00c2cb, 0 0 25px #00c2cb, 0 0 50px #00c2cb;
    transform: scale(1.05);
}

/* Hexagon Card Base Styles */
.hexagon-card {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(23, 31, 42, 0.5);
}

.hexagon-card-wrapper:hover .hexagon-card {
    transform: scale(1.05);
}

.hexagon-card .hexagon-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* To jest odpowiednik background-size: cover */
    object-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    /* Przycinamy obrazek do kształtu heksagonu */
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hexagon-card-wrapper:hover .hexagon-bg-img {
    opacity: 1;
}

.hexagon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 14, 20, 0.8), rgba(10, 14, 20, 0.2));
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.hexagon-card-wrapper:hover .hexagon-overlay {
    opacity: 1;
}

.hexagon-content {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease-in-out;
}

.hexagon-card-wrapper:hover .hexagon-content {
    color: #fff;
}

.hexagon-card-wrapper:hover .hexagon-icon {
    color: #00c2cb;
}

/* Main Grid Layout */
.honeycomb-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 900px;
    margin: auto;
}

.hexagon-card-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 115.47%; /* Aspect ratio for a regular hexagon */
    height: 0;
}

#subcategory-view {
    min-height: 700px;
    padding-top: 2.5rem; /* <-- Zmniejszona wartość */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    opacity: 1;
    transform: translateY(0);
}

#diagram-container {
    position: relative;
    height: auto;
    margin-bottom: 12rem;
}

.active-category-container {
    position: absolute;
    top: 50%;
    left: 20%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 322px;
    cursor: pointer;
}

.active-category-container:hover .hexagon-card {
    background-color: rgba(23, 31, 42, 0.8);
}

.subcategory-items-container {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
    padding-bottom: 12rem;
    margin-left: auto;
    margin-right: 0;
    width: 50%;
}

/* --- NEW, IMPROVED SUBSTANCE CARD STYLES --- */
.subcategory-card {
    display: block;
    background-color: rgba(23, 31, 42, 0.7);
    border-left: 3px solid rgba(0, 194, 203, 0.4);
    transition: all 0.3s ease-in-out;
    padding: 1.25rem 2.5rem 1.25rem 1.5rem; /* Zwiększony padding po prawej */
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    
    /* Ta właściwość tworzy niestandardowy kształt */
    clip-path: polygon(0% 0%, calc(100% - 25px) 0%, 100% 50%, calc(100% - 25px) 100%, 0% 100%);
}

.subcategory-card:hover {
    background-color: rgba(0, 194, 203, 0.1);
    border-left-color: rgba(0, 194, 203, 0.8);
    transform: translateX(5px) scale(1.02);
}

/* apppfpl/static/apppfpl/css/style.css */

/* --- GŁÓWNY OPIS SUBSTANCJI (większa widoczność) --- */
.subcategory-card p {
    color: #cbd5e1; /* jaśniejszy, bardziej czytelny kolor */
    font-size: 0.95rem; /* nieco większa czcionka */
    line-height: 1.5;
}

/* --- SIATKA Z DODATKOWYMI DANYMI (mniejsza widoczność) --- */
.subcategory-card .details-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    align-items: center;
    opacity: 0.7; /* Zmniejsza widoczność całego bloku */
    transition: opacity 0.3s ease;
}

/* Podświetlenie po najechaniu myszką */
.subcategory-card:hover .details-grid {
    opacity: 1;
}

/* Etykiety (np. "Nazwa chemiczna") */
.subcategory-card .details-grid strong {
    font-weight: 500; /* Cieńsza czcionka */
    color: #94a3b8;   /* Mniej nasycony kolor */
    text-align: right;
}

/* Wartości (np. nazwa chemiczna) */
.subcategory-card .details-grid span {
    color: #94a3b8; /* Ten sam stonowany kolor co etykiety */
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.subcategory-card .details-grid strong {
    font-weight: 600;
    color: #67e8f9;
    text-align: right;
}

.subcategory-card .details-grid span {
    color: #e0e0e0;
}


.subcategory-line-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: visible;
}

/* apppfpl/static/apppfpl/css/style.css */

.subcategory-line-svg path {
    stroke: rgba(0, 194, 203, 0.25); /* Zwiększona widoczność tła linii */
    stroke-width: 2.5; /* Grubsza linia tła */
    fill: none;
}

/* Impulse animation */
.impulse {
    stroke: #38bdf8; /* Lepszy, bardziej spójny kolor */
    stroke-width: 3px; /* Grubsza animowana linia */
    stroke-linecap: round;
    stroke-dasharray: 10 150;
    animation: impulse-animation 2.5s linear infinite;
    /* Dodajemy cień, który stworzy efekt poświaty */
    filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.7));
}

@keyframes impulse-animation {
  to {
    stroke-dashoffset: -160;
  }
}

.fade-out-up {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.fade-in-down {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease-in, transform 0.3s ease-in;
    transition-delay: 0.1s;
}

.subcategory-card > div {
  max-width: 100%;
  box-sizing: border-box;
}

#main-content,
.content-section {
  padding-bottom: 6rem;
  pointer-events: none;
  position: relative;
  z-index: 1;
  scroll-margin-top: 100px;
  overflow: hidden;
}

#main-content > main {
    pointer-events: auto;
}

footer {
  position: relative;
  margin-top: 8rem !important;
}

.subcategory-description {
  transition: all 0.3s ease-in-out;
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}
.subcategory-card.expanded {
  background-color: rgba(0, 194, 203, 0.2);
  border-color: rgba(0, 194, 203, 0.5);
}

.subcategory-card.expanded .subcategory-description {
  max-height: 1000px;
  opacity: 1;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 80px;
}

#main-content {
  flex: 1;
}

footer {
  position: relative;
  z-index: 10;
  margin-top: auto;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #999;
}

/* Nowe reguły dla strony "Nasza misja", aby tło było klikalne */
.mission-page-container {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.mission-page-container > div {
    pointer-events: auto;
}

/* Nowe reguły dla strony substancji */
.substance-page-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 4rem 1rem;
    pointer-events: none;
}

.substance-content-box {
    width: 100%;
    max-width: 64rem;
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    padding: 2.5rem;
    pointer-events: auto;
}

.info-card {
    background-color: rgba(55, 65, 81, 0.3);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.info-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #67e8f9;
    margin-bottom: 0.5rem;
}

.content-page-container {
    position: relative;
    z-index: 1;
    padding: 3rem 1rem;
    pointer-events: none;
    width: 100%;
}

.content-box {
    width: 100%;
    max-width: 56rem;
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    padding: 2.5rem;
    pointer-events: auto;
}

/* Style dla nowego menu nawigacyjnego */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(10, 14, 20, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 194, 203, 0.2);
}

.main-nav {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-logo .logo-cyan {
    color: #00c2cb;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 4px;
}

.nav-links a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #00c2cb;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a:hover:after {
    width: 100%;
}

.subcategory-card .details-grid span {
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0; /* Ważne dla layoutów grid/flexbox */
}

/* Klasa do płynnego zanikania elementów SVG */
.fade-out-fast {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/*
 * Ustawienie maksymalnej szerokości dla głównych kontenerów,
 * aby zapobiec rozciąganiu na szerokich ekranach.
*/
.substance-content-box,
.content-box,
.tripraport-container {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Styl dla kontenera na główne zdjęcie w poście bloga */
.blog-image-container {
    width: 100%;
    max-height: 450px; /* Maksymalna, stała wysokość dla obrazka */
    border-radius: 0.75rem; /* 12px */
    overflow: hidden; /* Ukrywa części obrazka wychodzące poza kontener */
    margin: 1.5rem 0; /* Marginesy góra/dół */
    background-color: #111827; /* Ciemne tło, gdyby obrazek się nie załadował */
}

/* Styl dla samego zdjęcia wewnątrz kontenera */
.blog-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Kluczowa właściwość: skaluje obraz, by pokrył cały kontener, przycinając nadmiar */
    object-position: center; /* Dba o to, by przycięcie było wyśrodkowane */
}

/* Blokuj sticky header na desktop */
#sticky-header {
    display: none;
}

@media (min-width: 1025px) {
    #sticky-header {
        display: none !important;
    }
}

/* Klasy pomocnicze dla object-position */
.object-position-top {
    object-position: center top;
}

.object-position-center {
    object-position: center center;
}

.object-position-bottom {
    object-position: center bottom;
}



/* ========================================
   NOWY, ZAKTUALIZOWANY DESIGN STRONY SZCZEGÓŁÓW SUBSTANCJI
   ======================================== */

/* Main container for the substance page content */
.substance-content-box {
    width: 100%;
    max-width: 1100px;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 194, 203, 0.3);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    pointer-events: auto;
}

/* --- Hero Header --- */
.substance-hero {
    background: linear-gradient(135deg, rgba(0, 194, 203, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
    padding: 2.5rem 2.5rem 1.5rem; /* Reduced padding */
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 194, 203, 0.2);
}

.category-badge {
    display: inline-block;
    background: rgba(0, 194, 203, 0.2);
    color: #00c2cb;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 194, 203, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-badge:hover {
    background: rgba(0, 194, 203, 0.3);
    color: #fff;
    text-decoration: none;
}

/* Reduced font size for the main title */
.substance-title {
    font-size: clamp(2.25rem, 4vw, 3rem); /* Smaller max size */
    font-weight: 900;
    color: #fff;
    margin: 0 0 0.75rem;
    text-shadow: 0 0 20px rgba(0, 194, 203, 0.2);
    line-height: 1.1;
}

/* Reduced font size for the subtitle */
.substance-subtitle {
    font-size: 1.125rem; /* Smaller subtitle */
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.9;
}

/* --- Main Content Area --- */
.substance-main-content {
    padding: 2.5rem;
}

/* Reduced font size for all section titles */
.section-title {
    font-size: 1.75rem; /* Smaller section titles */
    font-weight: 700;
    color: #00c2cb;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #00c2cb, #38bdf8);
    border-radius: 2px;
}

/* --- Properties Section ("Podstawowe informacje") --- */
.properties-section {
    margin-bottom: 3rem;
}

/* Forced 3-column layout and reduced gap for compactness */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Always 3 columns on desktop */
    gap: 1rem; /* Smaller gap */
}

/* Smaller property cards with less padding */
.property-card {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.4) 0%, rgba(31, 41, 55, 0.6) 100%);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 16px;
    padding: 1.25rem; /* Reduced padding */
    transition: all 0.3s ease;
}

.property-card:hover {
    border-color: rgba(0, 194, 203, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 194, 203, 0.1);
}

.property-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #00c2cb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.property-value {
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.5;
}

.property-value.formula {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 1.1rem;
    color: #38bdf8;
}

/* --- NEW, UNIFIED DOSAGE SECTION --- */
.dosage-section {
    background: linear-gradient(135deg, rgba(0, 194, 203, 0.05) 0%, rgba(56, 189, 248, 0.02) 100%);
    border: 1px solid rgba(0, 194, 203, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin: 2.5rem 0;
}

.dosage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3-column grid for all items */
    gap: 1rem;
}

.dosage-item {
    background: rgba(55, 65, 81, 0.4);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}
.dosage-item:hover {
    border-color: rgba(0, 194, 203, 0.5);
}

.dosage-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.dosage-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
}

.dosage-disclaimer {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

/* --- Long Description and other sections (no changes, but included for completeness) --- */
.description-section {
    margin: 3rem 0;
}

.description-content {
    color: #cbd5e1;
    line-height: 1.8;
    font-size: 1.0625rem;
}
.description-content h1, .description-content h2, .description-content h3 { color: #00c2cb; margin-top: 2rem; margin-bottom: 1rem; }
.description-content p { margin-bottom: 1.5rem; }
.description-content ul, .description-content ol { margin: 1.5rem 0; padding-left: 2rem; }
.description-content li { margin-bottom: 0.5rem; }

.tags-section { margin: 2rem 0; }
.tags-container { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.tag { background: rgba(0, 194, 203, 0.1); border: 1px solid rgba(0, 194, 203, 0.3); color: #00c2cb; padding: 0.5rem 1rem; border-radius: 25px; font-size: 0.875rem; font-weight: 500; transition: all 0.3s ease; }
.tag:hover { background: rgba(0, 194, 203, 0.2); transform: translateY(-1px); }

/* --- New Warning Box Styles --- */
.warning-box { display: flex; align-items: flex-start; gap: 1rem; background: linear-gradient(135deg, rgba(127, 29, 29, 0.15) 0%, rgba(59, 17, 17, 0.2) 100%); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 16px; padding: 1.5rem; margin: 2.5rem 0; }
.warning-icon { flex-shrink: 0; color: #ef4444; width: 2rem; height: 2rem; margin-top: 2px; }
.warning-text-content { flex-grow: 1; }
.warning-title { color: #fca5a5; font-weight: 700; font-size: 1.125rem; margin: 0 0 0.5rem 0; }
.warning-text-body { color: #fecaca; line-height: 1.6; margin: 0; }

.back-button-container { text-align: center; padding: 2rem; border-top: 1px solid rgba(75, 85, 99, 0.3); }
.glow-button { display: inline-block !important; background: linear-gradient(135deg, #00c2cb 0%, #38bdf8 100%) !important; color: #0a0e14 !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 1px !important; padding: 1rem 2.5rem !important; border-radius: 30px !important; text-decoration: none !important; transition: all 0.3s ease !important; box-shadow: 0 4px 20px rgba(0, 194, 203, 0.3) !important; position: relative; overflow: hidden; }
.glow-button:hover { transform: translateY(-2px) !important; box-shadow: 0 8px 30px rgba(0, 194, 203, 0.4) !important; text-decoration: none !important; color: #0a0e14 !important; }
.glow-button::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.5s; }
.glow-button:hover::before { left: 100%; }

/* --- Subtle animations (no changes) --- */
.property-card, .dosage-item { animation: fadeInUp 0.6s ease-out; animation-fill-mode: backwards; }
.property-card:nth-child(1), .dosage-item:nth-child(1) { animation-delay: 0.1s; }
.property-card:nth-child(2), .dosage-item:nth-child(2) { animation-delay: 0.2s; }
.property-card:nth-child(3), .dosage-item:nth-child(3) { animation-delay: 0.3s; }

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