@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed&display=swap');
@import url('https://fonts.googleapis.com/css?family=Open+Sans|Roboto:400,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Eater&family=Fredericka+the+Great&family=Montserrat&family=Roboto&family=Stick+No+Bills&display=swap');

:root {
  /* dark shades of primary color*/
  --clr-primary-1: hsl(205, 86%, 17%);
  --clr-primary-2: hsl(205, 77%, 27%);
  --clr-primary-3: hsl(205, 72%, 37%);
  --clr-primary-4: hsl(205, 63%, 48%);
  /* primary/main color */
  --clr-primary-5: hsl(205, 78%, 60%);
  /* lighter shades of primary color */
  --clr-primary-6: hsl(205, 89%, 70%);
  --clr-primary-7: hsl(205, 90%, 76%);
  --clr-primary-8: hsl(205, 86%, 81%);
  --clr-primary-9: hsl(205, 90%, 88%);
  --clr-primary-10: hsl(205, 100%, 96%);
  /* darkest grey - used for headings */
  --clr-grey-1: hsl(209, 61%, 16%);
  --clr-grey-2: hsl(211, 39%, 23%);
  --clr-grey-3: hsl(209, 34%, 30%);
  --clr-grey-4: hsl(209, 28%, 39%);
  /* grey used for paragraphs */
  --clr-grey-5: hsl(210, 22%, 49%);
  --clr-grey-6: hsl(209, 23%, 60%);
  --clr-grey-7: hsl(211, 27%, 70%);
  --clr-grey-8: hsl(210, 31%, 80%);
  --clr-grey-9: hsl(212, 33%, 89%);
  --clr-grey-10: hsl(200, 4%, 31%);
  --clr-white: #fff;
  --clr-red-dark: hsl(360, 67%, 44%);
  --clr-red-light: hsl(360, 71%, 66%);
  --clr-green-dark: hsl(103, 28%, 39%);
  --clr-green-light: hsl(125, 71%, 66%);

  --clr-vege-dark: hsl(103, 59%, 56%);
  --clr-vege-light: hsl(125, 71%, 66%);
  --clr-meat-light: hsl(49, 73%, 65%);
  --clr-meat-dark: hsl(49, 77%, 57%);

  --clr-black: #222;
  --ff-primary: "Roboto", sans-serif;
  --ff-secondary: "Open Sans", sans-serif;
  --transition: all 0.3s linear;
  --spacing: 0.1rem;
  --radius: 0.25rem;
  --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  --max-width: 1170px;
  --fixed-width: 620px;
}

body {
    min-height: 80vh;
    padding-top: 70px;
    min-height: -webkit-fill-available;
    background-image: url("https://wallpapercave.com/w/wp2128229.jpg");
}
  
  
html {
    height: -webkit-fill-available;
    font-size: 14px; /* zmienia skalę całej aplikacji */
}
  
main {
    height: 90vh;
    height: -webkit-fill-available;
    max-height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--clr-grey-5);
}


nav {
  background: var(--clr-primary-6);
  box-shadow: var(--light-shadow);
  font-weight: bold; 
  /* opacity: 0.85; */
}

.navbar-toggler {
  font-size: 1.5rem;
  color: var(--clr-primary-5);
  background: transparent;
  border-color: transparent;
  transition: var(--transition);
  cursor: pointer;
}
.navbar-toggler:hover {
  color: var(--clr-primary-1);
  transform: rotate(90deg);
}
.logo {
  height: 40px;
}

.ornament {
  font-family: 'Eater', serif;
  font-size: 100px;
}

.timer, .slider {
  font-family: 'Stick No Bills', sans-serif;
  font-size: 26px;
}
.item-pointer:hover {
  cursor: pointer;
}

.highlight-blink {
    animation: highlightFade 2s ease-out;
}

@keyframes highlightFade {
    0% { background-color: #ffe066; }
    50% { background-color: #fff3bf; }
    100% { background-color: transparent; }
}

.navbar .nav-item .dropdown-menu{  display:block; opacity: 0;  visibility: hidden; transition:.3s; margin-top:0; background-color: var(--clr-primary-5); }
.navbar .nav-item:hover .nav-link{ color: var(--clr-red-dark); }
.navbar .dropdown-menu.fade-down{ top:80%; transform: rotateX(-75deg); transform-origin: 0% 0%; }
.navbar .dropdown-menu.fade-up{ top:180%;  }
.navbar .nav-item:hover .dropdown-menu{ transition: .3s; opacity:0.85; visibility:visible; top:100%; transform: rotateX(0deg); }

.glass-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
}

.glass-card-solid {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #212529;
}

.glass-inner-card {
  position: relative;
  overflow: hidden;
}

.glass-inner-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0);
  transition: border-color .25s ease;
  pointer-events: none;
}

.glass-inner-card:hover::before {
  border-color: rgba(255,255,255,0.5);
}

/* ===== PRIVACY BLUR (toggle kwot w kafelku) ===== */
.money-blur {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
    transition: filter 0.3s ease;
}

/* action icons */
.item-remove, .item-add {
  cursor: pointer;
}

.item-add:hover {
  color: var(--clr-green-light) !important;
}

.item-remove:hover {
  color: var(--clr-red-dark) !important;
}

/* ===== BOOTSTRAP GLASS TOOLTIP (dla innych elementów) ===== */
.tooltip.tooltip-glass .tooltip-inner {
  background: rgba(31, 41, 55, 0.9);
  backdrop-filter: blur(6px);
  color: #f9fafb;
  font-size: 1.1rem;
  padding: .6rem .9rem;
  border-radius: .6rem;
}

.tooltip.tooltip-glass .tooltip-arrow::before {
  border-top-color: rgba(31, 41, 55, 0.85);
}

/* ===== CSS-ONLY GLASS TOOLTIP (dla filtra portfeli — bez Bootstrap Tooltip API) ===== */
[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: .5rem .85rem;
  border-radius: .55rem;
  font-size: 1rem;
  line-height: 1.4;
  color: #f9fafb;
  background: rgba(31, 41, 55, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 1080;
}

[data-tip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(31, 41, 55, 0.9);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 1080;
}

[data-tip]:hover::after,
[data-tip]:hover::before {
  opacity: 1;
  visibility: visible;
}

.text-profit-positive {
    color: var(--bs-success);
}

.text-profit-negative {
    color: var(--bs-danger);
}

.cursor-pointer {
  cursor: pointer;
}

.timer, .slider {
  font-family: 'Stick No Bills', sans-serif;
  font-size: 26px;
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--clr-white);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.scroll-to-top:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(0) scale(1.1);
}

.scroll-to-top:active {
  transform: translateY(0) scale(0.95);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

/* ===== STICKY TABLE WITH SCROLL ===== */
#portfolio-page {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px); /* navbar (70px) + footer (~50px) + margins */
}

#portfolio-page .card-header {
  flex-shrink: 0;
  position: sticky;
  top: 70px; /* wysokość navbara */
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

#portfolio-page .table-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--clr-primary-5) rgba(255,255,255,0.3);
}

#portfolio-page .table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#portfolio-page .table-wrapper::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

#portfolio-page .table-wrapper::-webkit-scrollbar-thumb {
  background: var(--clr-primary-5);
  border-radius: 4px;
}

#portfolio-page .table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--clr-primary-4);
}

/* Sticky thead */
#portfolio-page thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--clr-grey-9);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#portfolio-page thead th {
  background: var(--clr-grey-9);
  padding: 0.75rem 0.5rem;
}

/* Sticky tfoot */
#portfolio-page tfoot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--clr-grey-9);
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

#portfolio-page tfoot th {
  background: var(--clr-grey-9);
  padding: 0.75rem 0.5rem;
  font-weight: 700;
}

/* Card footer sticky at bottom */
#portfolio-page .card-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

/* Responsive - mobile */
@media (max-width: 768px) {
  #portfolio-page {
    max-height: calc(100vh - 120px);
  }
  
  #portfolio-page .card-header {
    top: 60px;
  }
  
  /* Horizontal scroll dla tabeli na mobile */
  #portfolio-page .table {
    min-width: 1000px;
  }
  
  #portfolio-page thead th,
  #portfolio-page tfoot th {
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem;
  }
  
  #portfolio-page tbody td {
    font-size: 0.85rem;
    padding: 0.4rem 0.25rem;
  }
}
/* ===== STICKY TABLE WITH SCROLL — NET WORTH PAGE ===== */
#net-worth-page {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px); /* navbar (70px) + footer (~50px) + margins */
}

#net-worth-page .card-header {
  flex-shrink: 0;
  position: sticky;
  top: 70px; /* wysokość navbara */
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

#net-worth-page .card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#net-worth-page .table-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--clr-primary-5) rgba(255,255,255,0.3);
}

#net-worth-page .table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#net-worth-page .table-wrapper::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

#net-worth-page .table-wrapper::-webkit-scrollbar-thumb {
  background: var(--clr-primary-5);
  border-radius: 4px;
}

#net-worth-page .table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--clr-primary-4);
}

/* Sticky thead */
#net-worth-page thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--clr-grey-9);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#net-worth-page thead th {
  background: var(--clr-grey-9);
  padding: 0.75rem 0.5rem;
}

/* Sticky tfoot — zachowuje semantyczne kolory wierszy (table-danger/primary/success) */
#net-worth-page tfoot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

/* Nieprzezroczyste tło sticky-left pierwszej kolumny — maskuje treść przy scrollu poziomym */
#net-worth-page tfoot td[style*="position: sticky"] {
  background-color: var(--bs-body-bg);
}

/* Card footer sticky at bottom */
#net-worth-page .card-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

/* Responsive - mobile */
@media (max-width: 768px) {
  #net-worth-page {
    max-height: calc(100vh - 120px);
  }

  #net-worth-page .card-header {
    top: 60px;
  }

  /* Horizontal scroll dla tabeli na mobile */
  #net-worth-page .table {
    min-width: 1000px;
  }

  #net-worth-page thead th {
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem;
  }

  #net-worth-page tbody td {
    font-size: 0.85rem;
    padding: 0.4rem 0.25rem;
  }
}



.btn-gradient {
    /* kolor bazowy zgodny z kluczem */
    --key-base: hsl(205, 89%, 70%);
    --key-dark: hsl(205, 78%, 55%);
    --key-light: hsl(205, 95%, 82%);

    background:
        linear-gradient(
            135deg,
            var(--key-light) 0%,
            var(--key-base) 45%,
            var(--key-dark) 100%
        );

    border: 1px solid rgba(255, 255, 255, 0.35);

    color: hsl(209, 61%, 16%);
    font-weight: 600;
    letter-spacing: 0.03em;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.45),
        0 6px 18px rgba(0,0,0,0.25);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-position 0.4s ease;
}

.btn-gradient:hover {
    background:
        linear-gradient(
            135deg,
            var(--key-light) 10%,
            var(--key-base) 50%,
            var(--key-dark) 90%
        );

    transform: translateY(-1px);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 10px 28px rgba(0,0,0,0.35);

    color: hsl(209, 61%, 16%);
}

.btn-gradient:active {
    transform: translateY(1px);

    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.25),
        0 4px 10px rgba(0,0,0,0.2);
}
