/* FLEXBOX LAYOUT FIX */
#page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

#body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  overflow: visible; /* Dodane, aby obramowanie nie było przycinane */
}

#footer {
  flex-shrink: 0;
  position: relative;
  bottom: auto;
  width: 100%;
}


/* POPRAWIONE ZAKŁADKI (TABS) - PEŁNA SZEROKOŚĆ Z WIDOCZNYM OBRAMOWANIEM */
.tabs-container {
  position: relative;
  min-height: 300px;
  margin-bottom: 20px;
  overflow: visible; /* Zapobiega przycinaniu obramowania */
}

ul.tabs {
  position: relative;
  display: flex;
  width: 100%;
  padding: 0;
  margin: 0;
  border-bottom: 1px solid green;
  margin-bottom: 10px;
  list-style: none;
  z-index: 20;
}

ul.tabs li {
  flex: 1;
  text-align: center;
}

ul.tabs .tab-label {
  display: block;
  border: 1px solid green;
  margin: 0;
  padding: 2px 0;
  background: white url("../theme/g1.jpg") repeat-x left bottom;
  font-weight: normal;
  cursor: pointer;
  position: relative;
}

ul.tabs li.selected .tab-label {
  border-bottom: 1px solid white;
  top: 1px;
  padding-bottom: 4px;
  padding-top: 2px;
  border-top: 2px solid green;
  margin-top: -2px;
  background: white url("../theme/g2.jpg") repeat-x left top;
  font-weight: bold;
}

/* KLUCZOWA POPRAWKA */
ul.tabs .tab-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  border: 1px solid green;
  border-top: none;
  padding: 15px;
  box-sizing: border-box;
  display: none;
  background: white;
  z-index: 10;
  min-height: 300px;
  height: auto;
  margin: 0 auto;
  max-width: 1024px;
}

ul.tabs li.selected .tab-content {
  display: block;
}

.tab-content-placeholder {
  min-height: 300px;
  visibility: hidden;
  width: 100%;
}

/* POPRAWIONE MENU */
.menu { 
  display: inline-block;
  position: relative; 
  z-index: 1; 
  cursor: pointer; 
  white-space: nowrap; 
  vertical-align: top;
  margin-right: 15px;
}

.menu a { 
  font-size: 0.9em; 
  text-decoration: none; 
  color: black; 
}

.menu h3 { 
  display: inline-block;
  margin: 0; 
  padding: 1px 5px; 
  background: url("../theme/g1.jpg") repeat-x left bottom white; 
}

.menu h4 { 
  display: inline; 
  margin: 0; 
}

.menu ul { 
  position: absolute; 
  margin: 0; 
  padding: 0; 
  padding-bottom: 5px; 
  background: url("../theme/g3.jpg") repeat-x left bottom white;  
}

.menu li { 
  margin: 0; 
  padding: 2px 25px; 
  list-style-type: none; 
  color: black; 
}

.menu li img { 
  margin-left: -22px; 
  padding-right: 5px; 
}

.menu li.separator { 
  margin-top: 5px; 
  border-top: 1px solid gray; 
  padding-top: 5px; 
}

.menu li.flyout-trigger { 
  background: url("../theme/flyout2.gif") no-repeat right center; 
} 

.menu h3.hover { 
  background: url("../theme/g2.jpg") repeat-x left top white; 
}

.menu li.hover { 
  background-color: firebrick; 
  color: white; 
}

.menu ul.dropdown { 
  top: 100%;  
  clear: left; 
}

.menu ul.submenu { 
  left: 100%; 
  margin-top: -1.5em; 
  margin-left: -0.3em; 
}

.menu .hidden { 
  left: -99999px; 
  top: -99999px; 
}

.menu h3, .menu ul { 
  border-left: 1px solid green; 
  border-right: 1px solid green; 
  border-top: 1px solid green; 
  border-bottom: 1px solid green; 
}

.menu li.flyout-trigger.hover { 
  background: url("../theme/flyout1.gif") no-repeat right center firebrick; 
}

.menu li.hover > a { 
  color: white; 
}

/* ROLLUP */
.rollup-trigger { 
  cursor: pointer; 
}

.rollup-trigger:hover { 
  color: firebrick; 
}

span.rollup-trigger { 
  font-size: 0.65em; 
  padding-left: 8px; 
  background: url("../theme/hide.gif") no-repeat left top; 
}

span.rolledup { 
  background: url("../theme/show.gif") no-repeat left top; 
}

/* MORE */
.more { 
  text-align: right; 
  font-weight: bold; 
  font-size: 0.8em; 
}

/* LISTS */
ul.block { 
  padding: 0; 
  padding-top: 5px; 
  margin: 0; 
  text-align: left; 
  font-weight: bold;  
}

ul.block li { 
  display: block; 
  padding-left: 10px;  
}

ul.list { 
  padding: 0; 
  padding-left: 20px; 
  margin: 0; 
  text-align: left; 
  font-weight: bold; 
}

ul.list li { 
  padding: 2px 0; 
}

ul.inline { 
  padding: 0; 
  margin: 0; 
  text-align: center; 
}

ul.inline li { 
  display: inline; 
  font-size: 0.8em;  
}

/* PRE-HEADER */
#preheader p { 
  font-size: 0.7em; 
  margin: 0; 
  padding: 3px 0; 
}

#preheader .part1 { 
  float: left;  
  margin-left: 10px;
}

#preheader .part2 { 
  float: right; 
  margin-right: 10px;
}

/* POPRAWIONY HEADER */
#header { 
  width: 100%; 
}

#header .oi { 
  border: 1px solid green; 
  padding: 5px 10px; 
  background: url("../theme/g4.jpg") repeat-x left top;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

#title { 
  flex: 1;
  display: flex;
  align-items: center;
  margin-top: 0px; 
}

#title h1 { 
  margin-right: 0px; 
}

#title .home { 
  margin: 0; 
  padding: 0; 
}

#search { 
  margin-top: 2px; 
  flex-shrink: 0;
}

.szukaj { 
  flex-shrink: 0;
}

#search input { 
  font-size: 0.8em; 
  background-color: white; 
  color: maroon; 
  border: 2px solid green;
}

#formularz { 
  flex-shrink: 0;
}

#formularz input { 
  font-size: 0.8em; 
  background-color: white; 
  color: maroon; 
  border: 2px solid green;
}

/* POST-HEADER */
#postheader p { 
  font-size: 0.7em; 
  margin: 0; 
  padding: 3px 0; 
}

#postheader .breadcrumbs { 
  float: left;  
  margin-left: 10px;
}

#postheader .sequential { 
  float: right; 
  margin-right: 10px;
}

/* POPRAWIONY BODY */
#nav { 
  width: 20%; 
  min-width: 100px; 
  float: none;
}

#nav .oi { 
  padding-right: 10px; 
}

#main { 
  width: 80%; 
  min-width: 600px; 
  margin-top: 10px; 
  font-size: 0.8em; 
  float: none;
  min-height: auto;
}

#main .oi { 
  padding-right: 10px;
  text-align: left;
}

/* FOOTER */
#footer ul.inline li { 
  display: inline-block; 
  margin: 0 10px; 
}

/* CONTENT SECTIONS */
.usage-section, .structure-section, .signal-words-section, 
.examples-section, .mistakes-section, .practice-section {
  width: 100%;    
  margin-bottom: 20px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.use-case {
  padding: 15px;
  border-left: 4px solid green;
  margin-bottom: 20px;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
  #nav, #main {
    width: 100% !important;
    min-width: unset !important;
  }
  
  #title, #search, .szukaj {
    width: 100%;
    flex: 0 0 100%;
    margin-bottom: 10px;
  }
  
  .menu {
    display: block;
    width: 100%;
    margin-bottom: 5px;
  }
  
  ul.tabs {
    flex-direction: column;
  }
  
  ul.tabs li {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .tabs-container {
    min-height: 200px;
  }
  
  .tab-content-placeholder {
    min-height: 200px;
  }
  
  #tablica, #tablica2 {
    width: 90%;
    transform: rotate(-3deg);
  }
}

/* DODATKOWE POPRAWKI */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

#page {
  overflow: hidden;
}

#body {
  position: relative;
}

#footer {
  background: #f8f8f8;
  padding: 15px 0;
  border-top: 1px solid #e7e7e7;
  margin-top: 30px;
}

#footer ul.inline {
  margin-bottom: 10px;
}

#footer .copyright {
  padding-top: 10px;
  border-top: 1px solid #ddd;
  margin-top: 10px;
}

/* ANIMACJE */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tab-content {
  animation: fadeIn 0.3s ease-in-out;
}