body 
{
  background-color: #f0f0f0;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  margin: 0;
  padding: 20px;
}

.container 
{
  max-width: 800px;
  margin: 0 auto;
  background-color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nadpis 
{
  font-size: 20px;
  font-weight: bold;
  color: #000000;
  text-align: center;
}

.footer 
{
  text-align: center;
  font-size: 12px;
  color: #666666;
  margin-top: 20px;
}

#name
{
  width: 4%;   
  border-collapse: collapse;
}

#street     
{
  width: 60%;
  border-collapse: collapse;
}

#product
{
  width: 60%;
  border-collapse: collapse;
}

#name, #email, #city
{
  width: 40%;
  border-collapse: collapse;
 
}

label, input
{
  margin: 5px ;
    font-weight: bold;
}


.predel 
{
  background-color: #d3ffd4;
    width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  text-align: center;
  border-radius: 5px;
}

button 
{
  background-color: #4CAF50; /* Green */
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  
  
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease; 
  margin-top: 20px;


}

.center-button 
{
  display: flex;
  justify-content: center;
}


hr 
{
  border: 1px solid #ccc;
  margin: 5px 0;
}

.modal-bg {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
  }
  /* Modal window */
  .modal {
    background: #fff;
    width: 500px;
    max-width: 90vw;
    margin: 100px auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
  }
  .modal button {
    margin-top: 20px;
  }

  .center-btn { text-align: center; }

  .dotaz {
    font-size: 16px;
    font-weight: bold;
    color: red;
    text-align: center;
    margin-top: 40px;
  }

  #neniok {
    background-color: lightcoral;
  }

  #kontrola {
    background-color: #d3ffd4;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
  }

  #doplatek_style {
    color: red;
  }

.info-success {
    background-color: #89fa8b;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
  }

  .info-error {
    background-color: lightcoral;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
  } 

  .info-warning {
    background-color: #ffeb3b; /* Yellow */
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
  }

  .qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
  }

  .text-center {
    text-align: center;
  }
  
  .qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  #inputvs {
    width: 40%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 10px;
  }

.button-container {
  display: flex;
  gap: 20px;
  margin: 10px 0; justify-content: center; align-items: center;
}


.animated-btn {
  display: inline-block;
  padding: 16px 32px;
  margin:10px;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(90deg, #4CAF50 0%, #66bb6a 100%);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: 
    transform 0.2s cubic-bezier(.4,2,.6,1),
    box-shadow 0.2s,
    background 0.3s;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15);
  position: relative;
  overflow: hidden;
}

.animated-btn:hover {
  transform: scale(1.07) translateY(-2px);
  background: linear-gradient(90deg, #388e3c 0%, #4CAF50 100%);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.25);
}

.animated-btn:active {
  transform: scale(0.97) translateY(1px);
  background: linear-gradient(90deg, #388e3c 0%, #388e3c 100%);
}



@media (max-width: 600px) {
  body, .container {
    padding: 10px;
  }

  .container {
    max-width: 100%;
    box-sizing: border-box;
  }

  .nadpis {
    font-size: 16px;
  }

  label, input {
    font-size: 14px;
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  #name, #email, #city, #street, #product, #inputvs {
    width: 100% !important;
    min-width: 0;
  }

  .qr-code {
    width: 120px;
    height: 120px;
  }

  .button-container, .center-button, .qr-code-container {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  button, .animated-btn {
    width: 100%; 
    font-size: 15px;
    padding: 12px;
    margin: 8px 0;
  }
}


#successModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}
#successModal .modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    position: relative;
    min-width: 300px;
    text-align: center;
}
#successModal .close {
    position: absolute;
    top: 10px; right: 15px;
    cursor: pointer;
    font-size: 18px;
}


.uvitani {
  background-color: #d3ffd4;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  margin-top: 20px;
}

#loadingOverlay {
  display: none;
  justify-content: center;
  align-items: center;
}

#loadingOverlay.active {
  display: flex;
}


.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #4CAF50;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  body, .container {
    padding: 10px;
  }

  .container {
    max-width: 100%;
    box-sizing: border-box;
  }

  .nadpis {
    font-size: 16px;
  }

  label, input {
    font-size: 14px;
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  #name, #email, #city, #street, #product, #inputvs {
    width: 100% !important;
    min-width: 0;
  }

  .qr-code {
    width: 120px;
    height: 120px;
  }

  .button-container, .center-button, .qr-code-container {
    display: flex; 
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  button, .animated-btn {
    width: 100%; max-width: 300px;
    font-size: 15px;
    padding: 12px;
    margin: 8px 0;
  }
}


@media (max-width: 480px) {
  #successModal .modal-content {
    padding: 15px;
    font-size: 0.95rem;
  }

  #successModal .modal-content h2 {
    font-size: 1.2rem;
  }

  #successModal li {
    font-size: 0.95rem;
  }

  #successModal img.qr-code {
    max-width: 140px;
  }
}

@media (max-width: 480px) {
  .modal {
    width: 100%;
    padding: 20px;
    border-radius: 6px;
  }

  .modal h3 {
    font-size: 1.2rem;
  }

  .modal button {
    width: 100%;
    font-size: 1rem;
    padding: 12px;
  }

  .modal-content p {
    font-size: 0.95rem;
  }

  .modal .close {
    font-size: 20px;
    top: 8px;
    right: 10px;
  }
}

.faktury-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.95rem;
}

.faktury-table th,
.faktury-table td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.faktury-table th {
  background-color: #f4f4f4;
}

.faktury-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.placeno {
  color: green;
  font-weight: bold;
}

.neplaceno {
  color: red;
  font-weight: bold;
}

@media (max-width: 768px) {
  .faktury-table {
    font-size: 0.85rem;
  }

  .faktury-table th, .faktury-table td {
    padding: 8px;
  }
}

.filter-form {
  margin-bottom: 20px; font-size: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center; background-color: rgb(230, 230, 230);
}

.filter-form label {
  font-weight: bold;
  margin-right: 5px;
}

.filter-form input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 150px;
  flex-grow: 1;
}

.filter-form button, 
.filter-form a {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: white;
  background-color: #4CAF50;
  transition: background-color 0.3s ease;
}

.filter-form button:hover, 
.filter-form a:hover {
  background-color: #388e3c;
}

.filter-form a {
  background-color: #888;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* plynulé scrollování na iOS */
}

.faktury-table {
  width: 100%;       /* zaplní celý kontejner */
  font-size: 13px;
  table-layout: fixed; /* pevné rozložení sloupců */ 
  word-wrap: break-word; /* zalomení dlouhého textu */
}

.faktury-table th, .faktury-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* nebo můžeš změnit na normal pokud chceš zalamování */
  padding: 8px;
  vertical-align: middle;
}

.faktury-table .animated-btn {
  padding: 6px 12px;      /* menší vnitřní odsazení */
  font-size: 0.85rem;     /* menší písmo */
  min-width: auto;        /* zruší minimální šířku, pokud je nastavena */
  height: auto;           /* přizpůsobí výšku obsahu */
  line-height: 1.2;       /* zmenší výšku řádku */
}

.faktury-table tr.paid {
  background-color: #d4edda;  /* světlá zelená */
  color: #155724;             /* tmavě zelený text */
}

.placeno {
  color: #2e7d32; /* tmavě zelená */
  font-weight: bold;
  font-size: 1.2em;
}

.neplaceno {
  color: #d32f2f; /* sytě červená */
  font-weight: bold;
  font-size: 1.2em;
}

@media (max-width: 600px) {
  .faktury-table {
    font-size: 0.85rem;
  }

  .faktury-table th, .faktury-table td {
    padding: 6px;
  }

  /* Pokud je scroll povolen, skryj ho, aby nebyl špatný UX */
  .table-responsive {
    overflow-x: visible;
  }
}

.podnadpis
{
  font-size: 18px;
  font-weight: bold;
  color: #000000;
  text-align: center;
  background-color: #75f678;
  border:1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  margin-top: 20px; 
}

.platba-prevod {
  background-color: #f1fdf1; /* světle zelená pro převodem */
}


.paid {
  font-weight: bold;
  background-color: #cefca5;
  /* můžeš přidat další styly pro zaplacené faktury */
}






/* Základní tabulka */
.faktury-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  font-size: 14px;
  display: table;
}

.faktury-table th,
.faktury-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

/* Stav placení */
.placeno {
  color: green;
  font-weight: bold;
}
.neplaceno {
  color: red;
  font-weight: bold;
}

/* Barvy podle typu platby */
tr.platba-prevod {
  background-color: #f0f8ff;
}
tr.platba-hotove {
  background-color: #fffaf0;
}
tr.paid {
  opacity: 0.7;
}

/* Reakce na mobilní zařízení */
@media (max-width: 768px) {
  .faktury-table,
  .faktury-table thead,
  .faktury-table tbody,
  .faktury-table th,
  .faktury-table td,
  .faktury-table tr {
    display: block;
    width: 100%;
  }

  .faktury-table thead tr {
    display: none;
  }

  .faktury-table tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    padding: 10px;
    background: #f9f9f9;
  }

  .faktury-table td {
    position: relative;
    padding-left: 50%;
    border: none;
    border-bottom: 1px solid #eee;
  }

  .faktury-table td::before {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    color: #333;
  }

  .faktury-table td.vs-column::before {
    content: "VS";
  }
  .faktury-table td.name-column::before {
    content: "Jméno";
  }
  .faktury-table td.product-column::before {
    content: "Produkt";
  }
  .faktury-table td.price-column::before {
    content: "Doplatek";
  }
  .faktury-table td.stav::before {
    content: "Zaplaceno";
  }
  .faktury-table td:last-child::before {
    content: "Faktura";
  }
}

/* Prázdný stav */
.no-data {
  text-align: center;
  font-style: italic;
  color: #777;
  padding: 20px;
}

.break {
  flex-basis: 100%;
  height: 0;
}

.user-panel {
  background-color: #e0f7fa;
  border: 1px solid #b2ebf2;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 1rem;
}

.user-panel p {
  margin: 0 0 10px;
  text-align: center;
}
