:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-color: #dfe6e9;
    --success-color: #2ecc71;
    --shadow-color: rgba(52, 152, 219, 0.2);
}

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: var(--text-color);
            background-color: var(--background-color);
            padding: 20px;
            max-width: 1200px;
            margin: 0 auto;
        }

body.menu-open {
    overflow: hidden;
}

        header {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
	display: flex; /* Ustawienie układu flexbox */
    flex-direction: column; /* Elementy w kolumnie */
    justify-content: center; /* Wyśrodkowanie w pionie */
    align-items: center; /* Wyśrodkowanie w poziomie */
        }

        h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
	text-align: center; /* Dodano wyrównanie do środka */
        }

        .description {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
        }

        .converter-container {
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

    .converter-card {
            flex: 1;
            background-color: white;
            border-radius: 10px;
			border: 1px solid var(--border-color); /* Brakujące obramowanie */
			box-shadow: 0 4px 15px var(--shadow-color);
            padding: 20px;
			transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

    .converter-card:hover {
			 transform: translateY(-5px);
             box-shadow: 0 8px 25px rgba(52, 152, 219, 0.25);
        }

        .converter-card h2 {
            color: var(--primary-color);
            margin-bottom: 15px;
            font-size: 1.5rem;
            text-align: center;
        }

        .input-group {
            margin-bottom: 15px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
        }

        input, select {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--border-color);
            border-radius: 5px;
            font-size: 1rem;
        }

        button {
            width: 100%;
            padding: 12px;
			background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 1rem;
            cursor: pointer;
			transition: all 0.3s ease;
            letter-spacing: 0.5px;
            margin-top: 10px;
        }

        button:hover {
           background-color: var(--secondary-color);
		   opacity: 0.9;
           box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
        }

        .result {
            margin-top: 20px;
            padding: 15px;
            background-color: rgba(52, 152, 219, 0.05); /* Lepsza integracja z kolorystyką */
            border-radius: 5px;
            text-align: center;
            font-size: 1.1rem;
        }

        .formula {
            margin-top: 15px;
            font-size: 0.9rem;
            color: #666;
            font-style: italic;
        }

        .conversion-table {
            margin-top: 40px;
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }

        th, td {
            padding: 12px;
            text-align: center;
            border: 1px solid var(--border-color);
        }

        th {
            background-color: var(--primary-color);
            color: white;
        }

        tr:nth-child(even) {
           background-color: rgba(52, 152, 219, 0.03); /* Zastosowanie zmiennej kolorystycznej */
        }

        .info-section {
            margin-top: 40px;
        }

        .info-section h2 {
            color: var(--primary-color);
            margin-bottom: 15px;
        }

        .info-section p {
            margin-bottom: 10px;
        }

.related-conversions {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.related-conversions h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.related-links {
    display: flex;
    flex-wrap: wrap; /* Pozwala na zawijanie linków */
    justify-content: center; /* Wyśrodkowanie linków */
    gap: 10px; /* Odstępy między linkami */
}

.related-links a {
    display: inline-block;
    text-align: center;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none; /* Usunięcie podkreślenia */
    border-radius: 5px; /* Zaokrąglone rogi */
    font-size: 1rem;
    width: calc(20% - 10px); /* Na desktopie pięć linków w jednym rzędzie */
    transition: background-color 0.3s ease;
}

.related-links a:hover {
    background-color: var(--secondary-color); /* Ciemniejszy niebieski po najechaniu */
}

/* Responsywność dla urządzeń mobilnych */
@media (max-width: 768px) {
    .related-links a {
        width: calc(50% - 10px); /* Na mobilnych dwa linki w jednym rzędzie */
        padding: 8px 10px; /* Zmniejszenie wypenienia linków */
        font-size: 0.9rem; /* Mniejsza czcionka */
    }
}

/* Stylizacja menu */
.navbar {
  background-color: #2980b9;
  color: #fff;
  width: 100%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  margin-bottom: 15px; /* Dodany odstęp między menu a headerem */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  overflow: visible; /* Zmiana z hidden na visible, aby menu rozwijane było widoczne */
}

.logo a {
  color: #fff;
  text-decoration: none;
  font-size: 1.8em;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.menu {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.menu > li {
  position: relative;
  margin: 0 5px;
}

.menu > li > a,
.dropdown-toggle {
  color: #fff;
  text-decoration: none;
  padding: 10px 15px;
  display: block;
  font-size: 1em;
  font-weight: 500;
  transition: background-color 0.3s;
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap; /* Zapobiega zawijaniu tekstu */
}

.menu > li > a:hover,
.dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
}

.arrow {
  font-size: 0.7em;
  margin-left: 5px;
  transition: transform 0.3s;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #fff;
  min-width: 180px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 5px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 100;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown:hover .arrow {
  transform: rotate(180deg);
}

.dropdown-menu li a {
  color: #333;
  padding: 10px 15px;
  display: block;
  text-decoration: none;
  transition: background-color 0.3s;
}

.dropdown-menu li a:hover {
  background-color: #f5f5f5;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.hamburger {
  width: 25px;
  height: 3px;
  background-color: #fff;
  display: block;
  position: relative;
  transition: background-color 0.3s;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 3px;
  background-color: #fff;
  display: block;
  transition: transform 0.3s;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

/* Poprawki dla mobile */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  
  body {
    position: relative;
  }
  
  body.menu-open {
    overflow: hidden;
  }
  
  /* Stylizacja nawigacji */
  .navbar {
    background-color: #2980b9;
    color: #fff;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1000;
    box-sizing: border-box;
  }

  .container {
    width: 100%;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
  }

  .logo {
    margin-right: auto; /* Przesuwa logo na lewo */
  }
  
  .logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: bold;
  }

  /* Stylizacja przycisku hamburgera */
  .menu-toggle {
	margin-left: auto; /* Przesuwa hamburger na prawo */  
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    position: relative;
    padding: 10px;
  }

  .hamburger {
    width: 25px;
    height: 3px;
    background-color: #fff;
    position: relative;
    transition: background-color 0.3s ease-in-out;
  }

  .hamburger::before,
  .hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out;
  }

  .hamburger::before {
    top: -8px;
  }

  .hamburger::after {
    top: 8px;
  }

  /* Animacja hamburgera po kliknięciu */
  .menu-toggle.active .hamburger {
    background-color: transparent;
  }

  .menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
  }

  .menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
  }

  /* Stylizacja menu mobilnego */
  .menu-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none;
  }

  .menu {
    display: none;
    flex-direction: column;
    background-color: #2980b9;
    width: 100%;
    max-width: 100%;
    padding: 10px 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 60px;
    left: 0;
    box-sizing: border-box;
    pointer-events: auto;
  }

  .menu.active {
    display: flex;
  }

  .menu > li {
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
  }

  .menu > li:last-child {
    border-bottom: none;
  }

  .menu > li > a,
  .dropdown-toggle {
    padding: 15px;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
  }

  /* Stylizacja dropdown menu */
  .dropdown {
    position: relative;
  }

  .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1em;
  }

  .arrow {
    transition: transform 0.3s;
  }

  .dropdown.active .arrow {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    position: static;
    display: none;
    background-color: #1e6fa5;
    width: 100%;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    box-sizing: border-box;
  }

  .dropdown.active .dropdown-menu {
    display: block;
  }

  .dropdown-menu li {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .dropdown-menu li a {
    color: #fff;
    padding: 12px 20px;
    font-size: 0.95em;
    display: block;
  }
}

@media (max-width: 768px) {
	header {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .description {
        font-size: 1rem;
    }
    .converter-container {
        flex-direction: row;
            }
    }
	
footer {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    color: white;
	text-align: center;
    padding: 25px 20px;
    border-radius: 15px;
    margin-top: 30px;
    box-shadow: 0 -4px 15px rgba(52, 152, 219, 0.2);
}

footer p {
    font-size: 1rem;
    letter-spacing: 0.5px;
}
