/* Navigation Bar */
.navbar {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    position: relative; /* NEW: Ensures proper layering for the dropdown */
    z-index: 1001;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
}

.navbar .logout-link {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    outline: none;
    text-rendering: inherit;
    letter-spacing: inherit;
    word-spacing: inherit;
    text-transform: inherit;
    text-indent: inherit;
    text-shadow: inherit;
    text-align: inherit;
    align-items: inherit;
    box-sizing: inherit;
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar a:hover,
.navbar .logout-link:hover {
    background-color: #34495e;
    border-radius: 5px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-menu {
    display: flex;
    list-style-type: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navbar-menu > li:not(:last-child) {
    margin-right: 1rem;
}

.navbar-menu > li {
    display: flex;
    align-items: center;
    position: relative;
}

.navbar .logout-form {
    margin: 0;
    padding: 0;
    display: inline-block;
}

/* Dropdown styles */

.navbar .dropdown {
    position: relative;
}

.navbar .dropdown-toggle {
    display: inline-block;
    cursor: pointer;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #ecf0f1;
    transition: all 0.3s ease;
}

.navbar .dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Positioned directly below the parent <li> */
    left: 0;
    background-color: #34495e; /* Match the hover color for consistency */
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    list-style-type: none;
    padding: 0;
    margin: 0;
    min-width: 160px;
    z-index: 1050; /* Ensures dropdown appears above other content */
    overflow: visible; /* Prevents clipping of the dropdown menu */
}

.navbar .dropdown-menu li {
    padding: 0.5rem 1rem;
    background-color: #2c3e50;
    transition: all 0.3s ease;
}

.navbar .dropdown-menu li:hover {
    padding: 0.5rem 1rem;
    background-color: #34495e;
}

.navbar .dropdown-menu li a {
    text-decoration: none;
    color: #ecf0f1;
    display: block;
    transition: all 0.3s ease;
}

.navbar .dropdown-menu li a:hover {
    background-color: #34495e; /* Slightly darker shade on hover */
    border-radius: 5px;
}

/* NEW: Show the dropdown menu on hover */
.navbar .dropdown:hover .dropdown-menu {
    display: block;
}

/* NEW: For JavaScript toggling (if using JS) */
.navbar .dropdown-menu.show {
    display: block;
}

/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

.fraction {
    font-size: small;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 20px;
}

.side-by-side-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.home-page-cards:first-child {
    display: inline-block;
    width: 70%;
    
}

.home-page-cards:nth-child(2) {
    
    display: inline-block;
    width: 20%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: #fff;
    border: none;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

form button,
form a.btn {
    all: unset;
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

form button:hover,
form a.btn:hover {
    background-color: #2980b9;}

.btn:hover {
    background-color: #2980b9;
}

/* Cards for Tournaments/Squads */
.card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
}

.card h2 {
    color: #2c3e50;
    margin-top: 0;
}

/* Dynamic Player Form Cards */
.player-form {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 5px;
    padding: 5px;
    transition: all 0.3s ease-in-out;
}

.player-form .form-details {
    max-height: 1000px; /* Large enough to contain content */
    opacity: 1;
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 1rem;
    color: #2c3e50;
}

.toggle-form {
    background: none;
    border: none;
    cursor: pointer;
    color: #3498db;
    padding: 5px;
}

.toggle-form:hover {
    color: #2980b9;
}

.player-form.minimized {
    background-color: #ecf0f1;
    padding: 10px 20px;
}

.player-form.minimized .form-details {
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.player-form.minimized p:not(.name-display p) {
    display: none;
}

.player-form.minimized .name-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-form.minimized .name-display p {
    display: block;  /* Ensure name fields and their labels remain visible */
    margin: 0;      /* Remove default paragraph margins */
}

.player-form.active {
    box-shadow: 0 0 0 2px #3498db;
}

.remove-player {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-player:hover {
    background-color: #c0392b;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-right: 1rem;
}

.input-group label {
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.input-group input {
    padding: 0.5rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}



/* Table Styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 25px 0;
    font-size: 0.9em;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

thead tr {
    background-color: #3498db;
    color: #ffffff;
    text-align: left;
}

th, td {
    padding: 12px 15px;
}

tbody tr {
    border-bottom: 1px solid #dddddd;
}

tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

tbody tr:last-of-type {
    border-bottom: 2px solid #3498db;
}

tbody tr:hover {
    background-color: #f5f5f5;
    transition: background-color 0.3s ease;
}

/* Responsive design */
@media (max-width: 767px) {
    table {
        font-size: 0.8em;
    }
    
    th, td {
        padding: 10px 12px;
    }
}

/* Optional: Sticky header */
thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Table sorting etc. with javascript */
.sort-asc::after {
    content: " ▲";
}

.sort-desc::after {
    content: " ▼";
}

#ball-search {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

/* Optional: Highlight current game column */
.current-game {
    background-color: #e74c3c;
    color: white;
}

/* Optional: Style for totals row */
.totals-row {
    font-weight: bold;
    background-color: #ecf0f1;
}

/* Optional: Centered text for numeric cells */
.numeric {
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-menu {
        margin-top: 1rem;
        flex-direction: column;
        width: 100%;
    }

    .navbar-menu li {
        margin: 0.5rem 0;
    }
}

/* Content styles */
h1, h2, h3 {
    color: #2c3e50;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 750px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#arsenal-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.arsenal-sequence {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: 33%;
    justify-content: space-evenly;
    grid-template-rows: auto;
  }
  
  .arsenal-ball {
    margin-bottom: 20px;
    width: 250px;
    /* Add more styles as needed */
  }
  
  .arsenal-field {
    margin: 5px 0;
  }
  
  .field-label {
    font-weight: bold;
  }

/* Messages modal formatting for colour and style */
.messages {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1200;
    list-style-type: none;
    padding: 0;
}

.messages li {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.messages .success {
    background-color: #d4edda;
    color: #155724;
}

.messages .error {
    background-color: #f8d7da;
    color: #721c24;
}

.messages .warning {
    background-color: #fff3cd;
    color: #856404;
}

.messages .info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.header-link {
    color: inherit;
    text-decoration: none;
  }
  .header-link:hover {
    text-decoration: underline;
  }

/* OilPattern component styling */

.oil-pattern-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1600px;  /* Increased to account for larger screens */
    margin: 0 auto;
    padding: 1rem;
  }
  
  .oil-pattern-info {
    flex: 0 0 40%;  /* Takes up 40% of the container width */
    max-width: 40%;
  }
  
  .oil-pattern-image {
    flex: 0 0 55%;  /* Takes up 55% of the container width */
    max-width: 55%;
    display: flex;
    justify-content: center;
    align-items: flex-start;  /* Align to top */
    overflow: hidden;  /* In case image is very tall */
  }
  
  .oil-pattern-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 80vh;  /* Limit height to 80% of viewport height */
  }
  
  @media (max-width: 1200px) {
    .oil-pattern-container {
      flex-direction: column;
    }
    
    .oil-pattern-info,
    .oil-pattern-image {
      flex: 0 0 100%;
      max-width: 100%;
    }
  }

  /* Image modal styling */

  .image-modal {
    display: none;
    position: fixed;
    z-index: 1100;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
  }
  
  .image-modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
  }
  
  #imageCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
  }
  
  .image-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
  }
  
  .image-close:hover,
  .image-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
  }

  