/* Tournament List */
.bvc-tournaments-list {
    margin: 2em 0;
}

.bvc-tournaments-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    background: #fff;
}

/* Tournament name links */
.bvc-tournament-name {
    text-decoration: none;
    cursor: pointer;
}

.bvc-tournament-name:hover {
    text-decoration: underline;
}

/* Players list container */
.bvc-players-list-container {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

@media screen and (max-width: 768px) {
    .bvc-players-list-container {
        padding: 12px;
        margin-top: 15px;
        background-color: #f9f9f9;
    }
    
    /* Add some spacing between the cards */
    .bvc-players-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

.bvc-players-list h3 {
    margin-bottom: 15px;
}

@media screen and (max-width: 768px) {
    .bvc-players-list h3 {
        margin-bottom: 12px;
        font-size: 1.2em;
    }
}

/* Category filter */
.bvc-category-filter-container {
    margin-bottom: 15px;
}

@media screen and (max-width: 768px) {
    .bvc-category-filter-container {
        margin-bottom: 12px;
    }
}

.bvc-category-filter {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

/* Players table */
.bvc-players-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border-spacing: 0;
}

.bvc-players-table th,
.bvc-players-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.bvc-players-table th {
    background: #f1f1f1;
    font-weight: 600;
}

.bvc-players-table tr:nth-child(even) {
    background: #f8f8f8;
}

/* Loading state */
.bvc-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Error state */
.bvc-error {
    color: #dc3232;
    padding: 10px;
    text-align: center;
}

/* Players table styles */
.bvc-players-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
    background-color: #fff;
}

.bvc-players-table th,
.bvc-players-table td {
    padding: 12px 16px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.bvc-players-table th {
    background: #f1f1f1;
    font-weight: 600;
    white-space: nowrap;
}

.bvc-players-table td strong {
    font-weight: 700;
    color: #333;
    display: inline-block;
}

@media screen and (max-width: 768px) {
    .bvc-players-table {
        font-size: 13px;
    }
    
    .bvc-players-table td strong {
        font-weight: 600;
    }
}

.bvc-players-table tr:nth-child(even) {
    background: #f8f8f8;
}

@media screen and (max-width: 768px) {
    .bvc-players-table tr:nth-child(even),
    .bvc-players-table tr:nth-child(odd) {
        background: #fff;
    }
    
    /* Consistent border for all cards */
}

/* Responsive table */

.bvc-tournaments-table th,
.bvc-tournaments-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e5e5e5;
}

.bvc-tournaments-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.bvc-register-button {
    display: inline-block;
    padding: 8px 16px;
    background: #000000;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: inherit;
    font-size: inherit;
    font-weight: normal;
    line-height: normal;
}

.bvc-register-button:hover {
    background: #A11F24;
    color: #fff;
    text-decoration: none;
}

#bvc-registration-form-container {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    padding: 20px;
    margin-top: 20px;
}

#bvc-registration-form-container .bvc-registration-form {
    margin: 0;
    padding: 0;
    border: none;
}

#bvc-registration-form-container p {
    margin: 0;
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Registration Form */
.bvc-registration-form {
    max-width: 600px;
    margin: 2em auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.bvc-form .form-row {
    margin-bottom: 1.5em;
}

.bvc-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.bvc-form input[type="text"],
.bvc-form input[type="email"],
.bvc-form input[type="tel"],
.bvc-form select,
.bvc-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.bvc-form textarea {
    height: 100px;
}

/* Help text style */
.help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

/* Player Sections */
.player-section {
    margin: 2em 0;
    padding: 1.5em;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.player-section h4 {
    margin: 0 0 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #e5e5e5;
    color: #23282d;
}

/* Add/Remove Player Buttons */
.bvc-add-player-button {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: inherit;
    font-size: inherit;
    font-weight: normal;
    line-height: normal;
}

.bvc-add-player-button:hover {
    background: #135e96;
}

.bvc-remove-player-button {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1em;
}

.bvc-remove-player-button:hover {
    background: #b32d2e;
}

.bvc-submit-button {
    background: #0073aa;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: inherit;
    font-size: inherit;
    font-weight: normal;
    line-height: normal;
}

.bvc-submit-button:hover {
    background: #005177;
}

/* Form Validation */
.bvc-error {
    padding: 10px;
    margin: 1em 0;
    background: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
    border-radius: 3px;
}

.bvc-error-summary {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-left: 4px solid #dc3232;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 3px;
}

.bvc-error-summary p {
    margin: 0 0 10px 0;
    color: #a94442;
    font-weight: 600;
}

.bvc-error-summary ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.bvc-error-summary li {
    color: #a94442;
    margin-bottom: 4px;
}

.field-error {
    display: block;
    color: #dc3232;
    font-size: 0.9em;
    margin-top: 4px;
}

.bvc-form input.error,
.bvc-form select.error {
    border-color: #dc3232;
    background-color: #fff8f8;
}

.bvc-form input.error:focus,
.bvc-form select.error:focus {
    border-color: #dc3232;
    box-shadow: 0 0 2px rgba(220, 50, 50, 0.8);
}

.bvc-registration-success {
    padding: 15px;
    margin: 1em 0;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
    border-radius: 3px;
}

/* Start List */
.bvc-startlist {
    margin: 2em 0;
    position: relative;
}

.bvc-startlist h3 {
    margin-bottom: 1em;
}

/* Filter Styles */
.bvc-startlist-filter {
    margin-bottom: 1.5em;
    display: flex;
    gap: 1em;
    align-items: center;
    flex-wrap: wrap;
}

.bvc-category-filter {
    min-width: 200px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    font-size: inherit;
}

.bvc-reset-filter {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: inherit;
    transition: all 0.2s ease;
}

.bvc-reset-filter:hover {
    background: #e5e5e5;
}

/* Table Container and Loading State */
.bvc-startlist-table-container {
    position: relative;
    overflow-x: auto;
    margin: 1em 0;
    min-height: 100px;
}

.bvc-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.bvc-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table Styles */
.bvc-startlist-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin: 0;
}

.bvc-startlist-table th,
.bvc-startlist-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e5e5e5;
}

.bvc-startlist-table th {
    background: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.bvc-startlist-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.bvc-startlist-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Responsive Design */
@media screen and (max-width: 600px) {
    .bvc-startlist-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }
    
    .bvc-category-filter,
    .bvc-reset-filter {
        width: 100%;
    }
    
    .bvc-startlist-table {
        border: 0;
    }
    
    .bvc-startlist-table thead {
        display: none;
    }
    
    .bvc-startlist-table tr {
        display: block;
        margin-bottom: 1em;
        border: 1px solid #e5e5e5;
        background: #fff;
    }
    
    .bvc-startlist-table td {
        display: block;
        text-align: right;
        padding: 12px;
        border: none;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .bvc-startlist-table td:last-child {
        border-bottom: 0;
    }
    
    .bvc-startlist-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: #666;
    }
}

/* Tournament Selection */
.bvc-tournament-select {
    margin: 2em 0;
    text-align: center;
}

.bvc-tournament-select select {
    padding: 8px;
    min-width: 200px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Responsive Design */
@media screen and (max-width: 600px) {
    .bvc-tournaments-table {
        display: block;
        overflow-x: auto;
    }
    
    .bvc-registration-form {
        padding: 15px;
    }
    
    .bvc-submit-button,
    .bvc-add-player-button,
    .bvc-remove-player-button {
        width: 100%;
    }
    
    .player-section {
        padding: 1em;
    }
}

/* BVC Registration Modal */
#bvc-registration-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#bvc-registration-modal .bvc-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
}

#bvc-registration-modal .bvc-modal-content {
  position: relative;
  background: #fff;
  padding: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  z-index: 10000;
}

#bvc-registration-modal .bvc-modal-close {
  position: sticky;
  top: -10px;
  margin-right: -15px;
  float: right;
  z-index: 10001;
  background: transparent;
  border: none;
  font-size: 40px;
  cursor: pointer;
  color: #333;
}

#bvc-registration-modal .bvc-modal-close:hover {
  color: #000;
}

/* RESPONSIVE TOURNAMENT LIST */
@media screen and (max-width: 768px) {
  /* Players table */
  .bvc-players-table {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
  }
  
  /* Modern card-style layout for players */
  .bvc-players-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.75em;
    padding: 0.75em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    border: 1px solid #ddd;
  }
  
  .bvc-players-table tbody tr:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  }
  
  .bvc-players-table th {
    display: none;
  }
  
  .bvc-players-table td {
    padding: 0.4em 0.5em;
    border: none;
    font-size: 0.95em;
    line-height: 1.3;
    position: relative;
  }
  
  /* Player number styling */
  .bvc-players-table td:first-child {
    position: absolute;
    top: 0.5em;
    left: 0.5em;
    background: #f1f1f1;
    color: #333;
    font-weight: bold;
    width: 2em;
    height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    font-size: 0.85em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    z-index: 1;
  }
  
  /* Layout for player names and team info */
  .bvc-players-table td:nth-child(2),
  .bvc-players-table td:nth-child(3) {
    width: 50%;
    padding-left: 2.5em; /* Increased space for the number */
    padding-right: 0.5em;
    position: relative;
  }
  
  .bvc-players-table td:nth-child(4),
  .bvc-players-table td:nth-child(5) {
    width: 50%;
    margin-top: 0.3em;
  }
  
  /* Data labels styling */
  .bvc-players-table td::before {
    content: attr(data-label);
    font-size: 0.75em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.2em;
  }
  
  /* Tournament list */
  .bvc-tournaments-list {
    width: 100%;
    border: 0;
  }
  
  .bvc-tournaments-list thead {
    display: none;
  }
  
  .bvc-tournaments-list tr {
    display: block;
    width: 100%;
    border: 1px solid #ccc;
    margin-bottom: 1em;
    padding: 1em;
    background: #fff;
    border-radius: 6px;
  }
  
  .bvc-tournaments-list td {
    display: block;
    width: 100%;
    padding: 0.5em 0;
    text-align: left;
    border: none;
    position: relative;
  }
  
  .bvc-tournaments-list td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 0.3em;
    color: #333;
  }
  
  .bvc-tournaments-list .bvc-register-button {
    display: block;
    width: 100%;
    margin-top: 1em;
  }
}
