/* === Ogólne ustawienia === */
body {

    background-color: #f4f4f4;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}
nav {
  display: flex;
  gap: 10px;
  justify-content: center;
flex-wrap: wrap;
background: #fff;
padding: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
position: fixed;
  top: 0;
  width: 100%;
}

/* === Kontenery === */
.container,
.login-container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin: 20vh auto 50px auto;
    max-width: 800px;

}

.wider-container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin: 20vh auto 50px auto;
    max-width: 1140px;

}

.table-responsive {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.wider-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    min-width: 800px; /* ważne: wymusza szerokość do przewijania */
}


.wider-container  table{
font-size: 10px;
}
.login-container {
    max-width: 400px;
}

.center {
    text-align: center;
}

/* === Nagłówki === */
h1, h2, h3 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

/* === Teksty === */
p {
    font-size: 16px;
    margin: 15px 0;
    color: #444;
}

strong {
    color: #222;
}

/* === Formularze i pola === */
label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #555;
}

input,
input[type="text"],
input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-top: 6px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* === Przycisk (główny) === */
button {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

button:hover {
    background-color: #45a049;
}

/* === Linki stylizowane jako przyciski === */
.button-link,
.link-button,
a.button-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #2196F3;
    color: white;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease;
}

.button-link:hover,
.link-button:hover,
a.button-link:hover {
    background-color: #1976D2;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
}


/* === Link wylogowania === */
.logout-link {
    background-color: #e53935;
}

.logout-link:hover {
    background-color: #c62828;
}

/* === Boxy z grami === */
.game-box {
    padding: 10px;
    border: 1px solid #ccc;
    display: inline-block;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 20px;
    text-align: center;
}

.game-box a {
    text-decoration: none;
    color: inherit;
}

.game-box img {
    max-height: 200px;
    width: auto;
    border-radius: 5px;
}

.game-box span {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

/* === Wiadomości i statusy === */
.msg {
    text-align: center;
    color: green;
    margin-bottom: 15px;
}

.note {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
}

.note.green {
    color: green;
}

.note.red {
    color: red;
}

#info {
    margin-top: 15px;
    color: red;
    text-align: center;
}

#dynamicVp {
    font-weight: bold;
}


.error-box {
    background: #ffe0e0;
    border: 1px solid #cc0000;
    padding: 10px;
    margin-bottom: 20px;
    color: #900;
    border-radius: 5px;
}

.success-box {
    background: #d0f2d0;
    border: 1px solid #3c983c;
    color: #2b662b;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.subscription-form {
    background: #f4f4f4;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.subscription-form label {
    display: block;
    margin-top: 10px;
}

.subscription-form input,
.subscription-form select {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
}

.subscription-tile.disabled-tile {
    background-color: #eee;
    color: #888;
    border: 1px solid #ccc;
}
.subscription-tile.disabled-tile button {
    pointer-events: none;
}
.warning-text {
    color: #b30000;
    font-weight: bold;
}
.wrapper-class{
display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.wrapper-class div{
padding: 10px 20px;
  border: 1px solid;
  border-radius: 10px;
}


/* --- Styl główny (dla desktopu) --- */
.roles-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
}

.roles-table th,
.roles-table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
}

.roles-table th {
    background-color: #f0f0f0;
    font-weight: bold;
}

.roles-table td:first-child {
    text-align: left;
    font-weight: bold;
}

/* --- Responsywność na telefony --- */
@media (max-width: 768px) {
    .roles-table {
        border: 0;
    }

    .roles-table thead {
        display: none;
    }

    .roles-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ccc;
        border-radius: 10px;
        background-color: #fff;
        padding: 15px;
    }

    .roles-table td {
        display: flex;
        align-items: center;
        padding: 8px 10px;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .roles-table td:last-child {
        border-bottom: none;
    }

    .roles-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #555;
    }

    .roles-table td input[type="checkbox"] {
        margin-left: auto;
    }

    .roles-table td button {
        width: 100%;
        margin-top: 10px;
    }
    nav{
        gap:5px;
    }

   nav a.button-link {
margin-top: 0px;
   }
   .wider-container {
  padding: 13vh 40px;
  margin: 0vh auto 50px auto;
}  
 .container {
  padding: 26vh 40px;
  margin: 0vh auto 50px auto;
}
.server-card .server-img{

  width:100%;
  height:auto;
  max-width:100%;
}
.roles-table :is(th, td):nth-child(2) {
  font-size: 20px;

}
.roles-table :is(th, td) {
  display: flex;
  flex-direction: column;
}
}

/* kontener kafla */
.server-card{
  display:flex;
  align-items:flex-start;
  gap:12px;
}

  .toolbar {display:flex; gap:10px; align-items:center; margin:12px 0; flex-wrap:wrap}
  .roles-table th a.sort { text-decoration:none; color:inherit }
  .adv-col { display:none }             /* hidden by default */
  .adv-on .adv-col { display:table-cell }
  .muted { color:#6b7280 }
  .inputs { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; align-items:end }
  .pagination { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin:8px 0 }
  .pagination a, .pagination span { padding:6px 10px; border:1px solid #e5e7eb; border-radius:8px; text-decoration:none }
  .pagination .current { background:#2563eb; color:#fff; border-color:#2563eb }
  code { white-space:nowrap }
  /* Mobile row-labels */
@media (max-width: 768px){
  .roles-table thead{ display:none; }

  .roles-table td{
    display:flex;
    gap:8px;
    align-items:flex-start;
    padding-block:8px;
  }
  .roles-table td::before{
    content: attr(data-label);
    font-weight:600;
    color:#555;

    display:block;
    font-size: small;
    letter-spacing: 2px;
  }
  .roles-table td > *{
    flex:1 1 auto;
    min-width:0;
    overflow-wrap:anywhere;
  }

  /* ukryj kolumny zaawansowane gdy przełącznik wyłączony */
  .roles-table .adv-col{ display:none; }
  .adv-on .roles-table .adv-col{ display:flex; } /* pokaż, gdy włączone */
}


/* GŁÓWNE: pozwól kolumnie z treścią się zwężać */
.server-body{
  flex:1 1 0;             /* rośnie, kurczy się, bazowo 0 */
  min-width:0;            /* <- bez tego flex-item potrafi przelewać */
}

/* zawijanie długich ciągów (URL/host:port itp.) */
.server-body,
.server-title,
.meta.address,
.mc-status{
  overflow-wrap:anywhere; /* nowocześniejsze */
  word-break:break-word;  /* fallback */
}

/* na wąskich ekranach lepiej w kolumnie */
@media (max-width: 600px){
  .server-card{ flex-direction:column; }
  .server-card .server-img{ flex:0 0 auto; }
}

/* defensywnie dla obrazków globalnie */
img{ max-width:100%; height:auto; }



.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    font-size: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.hidden {
    display: none;
}
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th, td { border: 1px solid #ccc; padding: 10px; text-align: left; }
        th { background-color: #f4f4f4; }
        .status-confirmed { color: green; }
        .status-pending { color: orange; }
        .status-invalid { color: red; }
        #notif {
            display: none;
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: #28a745;
            color: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.3);
            z-index: 9999;
        }


.danger-button {
    background-color: #cc0000;
    color: white;
    border: none;
    padding: 6px 12px;
    margin-top: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.danger-button:hover {
    background-color: #a30000;
}
.subscription-tile{
    width: 100%;
    max-width: 250px;
}

.subscription-tile.disabled-tile {
    background-color: #eee;
    color: #888;
    border: 1px solid #ccc;
    max-width: 250px;
}
.subscription-tile.disabled-tile button {
    pointer-events: none;
}
.warning-text {
    color: #b30000;
    font-weight: bold;
}
    .container.vouchers, .container.payment{
  max-width: 1200px;
}
    .container .balance{
  text-align: center;
  padding: 10px;
}
.card .inputs{
    align-items: center;
}

    .server-card{display:flex;gap:16px;align-items:center;background:#fff;border:1px solid #eee;border-radius: 0 0 8px 8px;padding:16px;margin-bottom:14px}
    .server-img{width: 100%;
  height: auto;border-radius:10px;object-fit:cover;background:#f6f6f6; flex:1;}
    .server-body{flex:3}
    .server-title{font-weight:700;margin:0 0 6px; font-size: 1.3rem;}
    .server-body .address{
        font-size: 1.2rem;
  display: flex;
  flex-direction: column;
  padding: 0px 0 10px 0px;
    }
    .meta{font-size:14px;color:#555;margin:4px 0}
    .ping-badge{padding:2px 8px;border-radius:8px;font-weight:600;display:inline-block}
    .ping-green{background:#d1fae5;color:#065f46}
    .ping-orange{background:#ffedd5;color:#9a3412}
    .ping-red{background:#fee2e2;color:#991b1b}
    .tabs{margin-bottom:10px}
    .tabs a{color: #000;
  text-decoration: none;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 8px 8px 0 0;
    }

        .login-container{max-width:560px;margin:3rem auto;padding:1.2rem;border:1px solid #eee;border-radius:10px}
    #info{margin-top:1em;color:#444;text-align:center;font-weight:bold}
    #loader{text-align:center;margin-top:1em;font-size:16px}
    .button-link{display:inline-block;margin:20px auto 0;padding:10px 20px;background:#2196F3;color:#fff;text-decoration:none;font-weight:bold;border-radius:6px;text-align:center}
    .button-link:hover{background:#1976D2}
    /* Fallback panel (ukryty dopóki nie wykryjemy braku rozszerzeń) */
    #manualPanel{margin-top:1rem;padding:1rem;border:1px dashed #bbb;border-radius:8px;background:#fafafa}
    #manualPanel h3{margin:0 0 .5rem 0}
    .row{display:block;gap:.5rem;align-items:center}
    .row input[type="password"]{flex:1;padding:.6rem}
    .muted{font-size:.9em;color:#666;margin-top:.5rem}

     /*  #manualPanel{
        opacity:0.5;
    }

 #manualPanel:before{
        content: 'not working yet';
        text-align: center;
        height: 100%;
        width: 100%;
        display: block;
        color: red;

    }*/

    .send-container{
        display: flex;
  align-items: baseline;
  gap: 5px;
    }

    .card #text{
width: 100%;
    }

    #messages .msg {
  text-align: left;
  color: green;
  margin-bottom: 15px;
}



#messages{
  position: relative;       /* <- anchor for absolute children   */
  overflow: hidden;         /* <- clip overlay to the box        */
  border-radius: 6px;       /* if you use rounding                */
}

/* Center overlay that fills the parent exactly */
.msg-loading{
  position: absolute;
  inset: 0;                 /* top:0; right:0; bottom:0; left:0  */
  width: 100%;
  height: 100%;
  display: none;            /* show via JS when loading           */
  align-items: center;
  justify-content: center;
  background: rgba(248,250,252,.7);
  z-index: 2;
  border-radius: inherit;   /* match parent's rounding            */
}

/* Top loading bar (for "older" fetch) stays inside the scroll area */
.msg-loading-top{
  position: sticky;
  top: 0;
  z-index: 3;
  display: none;
  padding: 6px 10px;
  background: #eaf1ff;
  color: #1f3b80;
  font-size: 12px;
  border-bottom: 1px solid #dbe7ff;
}
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #cfe1ff; border-top-color: #2563eb;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* pasek "Loading older…" na górze listy */
.msg-loading-top {
  display: none;
  position: sticky; top: 0; z-index: 3;
  padding: 6px 10px; background: #eaf1ff; color: #1f3b80;
  font-size: 12px; text-align: center; border-bottom: 1px solid #dbe7ff;
}

/* skeleton bąbelków przy pierwszym ładowaniu */
.skel {
  background: linear-gradient(90deg, #eef2f7, #f6f9ff, #eef2f7);
  background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 16px; height: 44px; margin: 6px 0; width: 58%;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.skel.right { margin-left: auto; }
@keyframes shimmer { 0%{background-position:0% 0} 100%{background-position:-200% 0} }

