/* === styles.css ===
  1. Base Styles
  2. Layout
  3. Typography
  4. Cards
  5. Navigation
  6. Tables
  7. Forms
  8. Modals
  9. Footer
 10. Groups & Players
 11. Utilities
 12. History Section
 13. Setup Section
 14. Login
 15. FullScreen
==================== */


/* === Base Styles === */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
    color: #343a40;
  }
  
  h1, h2, h3 {
    text-align: center;
    margin-block-start: 0.42em;
  }

/* === Layout === */
  .container {
    max-width: 800px;
    /*margin: 2rem auto;*/
    padding: 1rem;
  }
  
  .main-header {
    background-color: #343a40;
    color: #ffc107;
    padding: 0.3rem 0;
    text-align: center;
  }

/* === Typography === */

/* === Cards === */
  .card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
  .text-right {
  text-align: right;
}
  
  .card select {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
}
span.editsave {
    font-size: 0.8rem;
  }

  /* === Forms === */


    .main-nav button {
    display: inline-flex;       /* <-- vigtig ændring */
    align-items: center;
    justify-content: center;
    background: #343a40;
    color: white;
    border: 2px solid transparent;
    padding: 0.6rem 1.2rem;
    border-radius: 0.4rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;        /* undgå linjeskift i knaptekst */
    flex: 0 1 auto;              /* undgå at fylde hele rækken */
  }

  .dropdown-content button {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
  }
  .dropdownButton:hover {
    background: #f1f1f1;
  }

  button:hover:not(.toggle-pwd-icon):not(.dropdownButton) {
    background: #ffc107;
    color: #343a40;
  }

button.editsave {
    /*display: inline-flex;*/
    margin-bottom: 0.2rem;
    padding: 0.2rem;
    font-size: 0.8rem;
    border-radius: 0.4rem;
    border: 1px solid #ccc;
    box-sizing: border-box;
    white-space: nowrap;        /* undgå linjeskift i knaptekst */
    /*flex: 0 1 auto;               undgå at fylde hele rækken */
  }

  input, select, button:not(.main-nav button):not(.editsave):not(.toggle-pwd-icon):not(.dropdownButton) {
    /*display: inline-flex;*/
    margin-bottom: 0.4rem;
    padding: 0.6rem;
    font-size: 1rem;
    border-radius: 0.4rem;
    border: 1px solid #ccc;
    box-sizing: border-box;
    white-space: nowrap;        /* undgå linjeskift i knaptekst */
    /*flex: 0 1 auto;               undgå at fylde hele rækken */
  }

    .retro-controls button {
    font-size: 1.4rem;
    background: #fff;
    border: 2px solid #444;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-right: 0.5rem;
    box-shadow: inset -2px -2px 0 #ccc;
    transition: background 0.2s;
  }
  .retro-controls button:hover {
    background: #eee;
  }



  .main-nav button:hover {
    background: #ffc107;
    color: #343a40;
  }
  
  .main-nav button.active {
    background: #ffc107;
    color: #343a40;
    font-weight: bold;
  }

    .group-actions button {
    margin-right: 0.5rem;
  }

  input[type="number"] {
    max-width: 80px;
    text-align: center;
  }
  

/* === Navigation === */

/* === Tables === */
  table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
  }
  
  th, td {
    border: 1px solid #ccc;
    padding: 0.5rem;
    text-align: center;
    font-size: 12pt;
  }
  
  tbody tr:nth-child(even) {
    background: #f4f4f4;
  }
  


  

/* === Modals === */
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  .modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    width: 90%;
    max-width: 400px;
  }
  .modal-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  
  .spaced-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }
  
  .left-actions,
  .right-actions {
    display: flex;
    gap: 0.5rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.3rem;
  }
  
  .form-group input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
  }
  
  .setup-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.setup-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 300px;
}

/* === Footer === */
  .footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
  }
  
  .footer ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 1rem 0;
  }
  
  .footer li {
    display: inline-block;
  }
  
  .footer a {
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s ease;
  }
  
  .footer a:hover {
    color: #ffc107;
  }
  
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .modal-box {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  }

  .main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    background: transparent;
    padding: 0.5rem;
  }
  

  .history-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .history-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .history-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
  }
  
  .history-header .date {
    font-weight: normal;
    color: #888;
  }
  
  .history-header .state {
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
  }

/* === Groups & Players === */
  .position {
    width: 1.5rem;
    text-align: right;
    font-weight: bold;
  }
  
  /*Groups*/
  .group-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .group-card {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0,0,0,0.1);
    width: 250px;
  }


/* === Utilities === */
  .summary {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
  }
  
  .state.active {
    background: #d1ecf1;
    color: #0c5460;
  }
  .state.pause {
    background: #fff3cd;
    color: #856404;
  }
  .state.complete {
    background: #d4edda;
    color: #155724;
  }
  
  .history-players {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  
  .history-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
  }
  
  .history-actions button {
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }
  
  .history-actions button:hover {
    background: #ffc107;
    color: #2e2e2e;
  }
  
  .history-actions button:nth-child(1) {
    background-color: #4e6e50; /* afdæmpet grøn */
  }
  .history-actions button:nth-child(2) {
    background-color: #495f8b; /* afdæmpet blå */
  }
  .history-actions button:nth-child(3) {
    background-color: #7e4a49; /* afdæmpet rød */
  }
  .handle {
    cursor: grab;
    font-size: 1.2rem;
    padding: 0.5rem;
  }

  .player-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
  }

  .player-item select {
    width: 3rem;
  }
  

/* === History Section === */

/* === Setup Section === */

/* === Login === */

.header-login-btn:hover {
  color: #ffc107;
}

/* === Fullscreen  === */
.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  z-index: 999;
  overflow-y: auto;
  padding: 1rem;
}

/* === Dropdown-style === */
.dropdown {
  position: relative;
  display: inline-block;
  z-index: 1000;
}

.dropbtn {
  background-color: #343a40;
  color: white;
  padding: 8px 16px;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropbtn:hover,
.dropbtn:focus {
  background-color: #ffc107;
  color: #343a40;
}

.dropdown-content {
  display: block;
  position: absolute;
  background-color: white;
  min-width: 160px;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  right: 0;
  top: 110%;
  padding: 0.5rem 0;
}

.dropdown-content a {
  color: #333;
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

/* --- Login / auth tweaks --- */
.password-group {
  position: relative;
}
.password-group input {
  padding-right: 2.5rem; /* plads til ikon */
}
.toggle-pwd-icon {
  position: absolute;
  right: 0.0rem;
  transform: translateY(50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
}

.status-msg {
  margin-top: 0.5rem;
}

.auth-links {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.modal-box h3 { margin-top: 0; }

