/**
 * DLM - Dart League Manager - Frontend Styles
 * Compatible with Astra Theme
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --dlm-primary: #1e3a5f;
    --dlm-primary-light: #2a5298;
    --dlm-primary-dark: #0f1f33;
    --dlm-secondary: #e74c3c;
    --dlm-accent: #f39c12;
    --dlm-success: #27ae60;
    --dlm-warning: #f39c12;
    --dlm-danger: #e74c3c;
    --dlm-info: #3498db;
    --dlm-dark: #2c3e50;
    --dlm-gray: #7f8c8d;
    --dlm-light: #ecf0f1;
    --dlm-white: #ffffff;
    --dlm-bg: #f8f9fa;
    --dlm-border: #dee2e6;
    --dlm-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --dlm-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --dlm-radius: 8px;
    --dlm-radius-sm: 4px;
    --dlm-transition: all 0.3s ease;
    --dlm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */
.dlm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: var(--dlm-font);
}

.dlm-section {
    margin-top: 40px;
}

.dlm-section h2 {
    font-size: 1.5rem;
    color: var(--dlm-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--dlm-primary);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.dlm-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dlm-white);
    border-radius: var(--dlm-radius);
    overflow: hidden;
    box-shadow: var(--dlm-shadow);
    font-size: 0.95rem;
}

.dlm-table thead {
    background: var(--dlm-primary);
    color: var(--dlm-white);
}

.dlm-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dlm-table tbody tr {
    border-bottom: 1px solid var(--dlm-border);
    transition: var(--dlm-transition);
}

.dlm-table tbody tr:hover {
    background: rgba(30, 58, 95, 0.04);
}

.dlm-table tbody tr:last-child {
    border-bottom: none;
}

.dlm-table tbody td {
    padding: 10px 15px;
    vertical-align: middle;
}

.dlm-table .dlm-col-pos {
    width: 40px;
    text-align: center;
    font-weight: 700;
    color: var(--dlm-primary);
}

.dlm-table .dlm-col-logo {
    width: 36px;
    text-align: center;
}

.dlm-table .dlm-col-num {
    text-align: center;
    width: 60px;
}

.dlm-table .dlm-col-highlight {
    background: rgba(30, 58, 95, 0.05);
    font-weight: 700;
}

.dlm-table thead .dlm-col-highlight {
    background: rgba(255, 255, 255, 0.1);
}

.dlm-table .dlm-col-score {
    text-align: center;
    min-width: 80px;
}

.dlm-table .dlm-col-player-home {
    text-align: right;
    padding-right: 15px;
}

.dlm-table .dlm-col-player-away {
    text-align: left;
    padding-left: 15px;
}

/* Standings specifics */
.dlm-standings-table .dlm-top-three td:first-child {
    border-left: 3px solid var(--dlm-accent);
}

.dlm-team-logo-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 50%;
}

/* ==========================================================================
   Winner / Score / Status Highlights
   ========================================================================== */
.dlm-winner {
    font-weight: 700;
    color: var(--dlm-success);
}

.dlm-positive {
    color: var(--dlm-success);
    font-weight: 600;
}

.dlm-negative {
    color: var(--dlm-danger);
    font-weight: 600;
}

.dlm-score {
    font-weight: 700;
    text-align: center;
}

.dlm-vs {
    text-align: center;
    color: var(--dlm-gray);
    font-size: 0.85rem;
    font-weight: 600;
}

.dlm-empty {
    color: var(--dlm-gray);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.dlm-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 8px;
}

.dlm-badge-active, .dlm-badge-upcoming {
    background: var(--dlm-success);
    color: var(--dlm-white);
}

.dlm-badge-captain {
    background: var(--dlm-accent);
    color: var(--dlm-white);
}

.dlm-badge-completed {
    background: var(--dlm-gray);
    color: var(--dlm-white);
}

.dlm-status-scheduled { color: var(--dlm-info); }
.dlm-status-live { color: var(--dlm-danger); font-weight: 700; }
.dlm-status-completed { color: var(--dlm-success); }
.dlm-status-cancelled { color: var(--dlm-gray); text-decoration: line-through; }

/* Match status badge */
.dlm-match-status-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dlm-match-status-badge.dlm-status-live {
    background: var(--dlm-danger);
    color: var(--dlm-white);
    animation: dlm-pulse 1.5s infinite;
}

.dlm-match-status-badge.dlm-status-completed {
    background: var(--dlm-success);
    color: var(--dlm-white);
}

.dlm-match-status-badge.dlm-status-scheduled {
    background: var(--dlm-info);
    color: var(--dlm-white);
}

@keyframes dlm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==========================================================================
   Cards & Grids
   ========================================================================== */
.dlm-team-grid,
.dlm-league-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dlm-team-card,
.dlm-league-card {
    display: block;
    background: var(--dlm-white);
    border-radius: var(--dlm-radius);
    box-shadow: var(--dlm-shadow);
    padding: 25px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--dlm-dark);
    transition: var(--dlm-transition);
    border: 1px solid var(--dlm-border);
}

.dlm-team-card:hover,
.dlm-league-card:hover {
    box-shadow: var(--dlm-shadow-hover);
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--dlm-dark);
    border-color: var(--dlm-primary);
}

.dlm-team-card h3,
.dlm-league-card h3 {
    margin: 15px 0 8px;
    font-size: 1.1rem;
    color: var(--dlm-primary);
}

.dlm-team-card-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    margin: 0 auto;
    display: block;
}

.dlm-placeholder-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--dlm-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.dlm-placeholder-logo .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: var(--dlm-gray);
}

.dlm-team-card-location,
.dlm-team-card-league {
    font-size: 0.85rem;
    color: var(--dlm-gray);
    margin: 4px 0 0;
}

.dlm-team-card-location .dashicons,
.dlm-team-card-league .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* League card specifics */
.dlm-league-card {
    text-align: left;
}

.dlm-league-card-content {
    padding: 5px 0;
}

.dlm-league-card-season,
.dlm-league-card-teams {
    font-size: 0.85rem;
    color: var(--dlm-gray);
    margin: 5px 0;
}

.dlm-league-active {
    border-left: 4px solid var(--dlm-success);
}

/* ==========================================================================
   Stats Cards
   ========================================================================== */
.dlm-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.dlm-stat-card {
    background: var(--dlm-white);
    border-radius: var(--dlm-radius);
    box-shadow: var(--dlm-shadow);
    padding: 20px;
    text-align: center;
    border-top: 3px solid var(--dlm-primary);
}

.dlm-stat-card.dlm-stat-positive { border-top-color: var(--dlm-success); }
.dlm-stat-card.dlm-stat-negative { border-top-color: var(--dlm-danger); }
.dlm-stat-card.dlm-stat-highlight { border-top-color: var(--dlm-accent); }

.dlm-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--dlm-primary);
    line-height: 1.2;
}

.dlm-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--dlm-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* ==========================================================================
   Match Detail
   ========================================================================== */
.dlm-match-header {
    background: linear-gradient(135deg, var(--dlm-primary), var(--dlm-primary-light));
    color: var(--dlm-white);
    border-radius: var(--dlm-radius);
    padding: 30px;
    text-align: center;
}

.dlm-match-meta {
    margin-bottom: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.dlm-match-meta > * {
    margin: 0 10px;
}

.dlm-match-league {
    color: var(--dlm-white);
    text-decoration: underline;
}

.dlm-match-scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.dlm-match-team {
    flex: 1;
    max-width: 200px;
}

.dlm-match-team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
}

.dlm-match-team-name {
    display: block;
    color: var(--dlm-white);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.dlm-match-team-name:hover {
    text-decoration: underline;
    color: var(--dlm-white);
}

.dlm-match-score {
    text-align: center;
}

.dlm-score-home,
.dlm-score-away {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.dlm-score-separator {
    font-size: 2rem;
    margin: 0 10px;
    opacity: 0.7;
}

.dlm-score-vs {
    font-size: 1.5rem;
    opacity: 0.7;
    font-weight: 700;
}

/* Rounds / Results */
.dlm-round-block {
    margin-bottom: 25px;
}

.dlm-round-title {
    font-size: 1rem;
    color: var(--dlm-primary);
    margin-bottom: 10px;
    padding: 5px 10px;
    background: var(--dlm-light);
    border-radius: var(--dlm-radius-sm);
}

.dlm-results-table .dlm-col-player-home,
.dlm-results-table .dlm-col-player-away {
    width: 40%;
}

.dlm-results-table .dlm-col-score {
    width: 20%;
}

/* Lineups */
.dlm-lineups-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.dlm-lineup-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dlm-lineup-list li {
    padding: 8px 15px;
    border-bottom: 1px solid var(--dlm-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dlm-lineup-list li:last-child {
    border-bottom: none;
}

.dlm-substitute {
    opacity: 0.7;
    font-style: italic;
}

/* ==========================================================================
   Team & Player Profiles
   ========================================================================== */
.dlm-team-header,
.dlm-player-header {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--dlm-border);
}

.dlm-team-logo img,
.dlm-player-photo img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: var(--dlm-radius);
    box-shadow: var(--dlm-shadow);
}

.dlm-player-photo-placeholder {
    width: 150px;
    height: 150px;
    border-radius: var(--dlm-radius);
    background: var(--dlm-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dlm-player-photo-placeholder .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: var(--dlm-gray);
}

.dlm-team-name,
.dlm-player-name {
    font-size: 2rem;
    margin: 0 0 10px;
    color: var(--dlm-primary);
}

.dlm-player-number {
    color: var(--dlm-accent);
    margin-right: 5px;
}

.dlm-team-info p,
.dlm-player-info p {
    margin: 5px 0;
    color: var(--dlm-gray);
}

.dlm-team-info a,
.dlm-player-info a {
    color: var(--dlm-primary);
    text-decoration: none;
}

.dlm-team-info a:hover,
.dlm-player-info a:hover {
    text-decoration: underline;
}

.dlm-team-info .dashicons,
.dlm-player-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
    color: var(--dlm-primary);
}

/* ==========================================================================
   Location
   ========================================================================== */
.dlm-location-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.dlm-location-image {
    flex: 0 0 300px;
}

.dlm-location-image img {
    width: 100%;
    border-radius: var(--dlm-radius);
}

.dlm-location-info h1 {
    color: var(--dlm-primary);
    margin-bottom: 15px;
}

.dlm-location-info p {
    margin: 8px 0;
    color: var(--dlm-gray);
}

.dlm-location-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
    color: var(--dlm-primary);
}

/* ==========================================================================
   Tournament Bracket
   ========================================================================== */
.dlm-bracket {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 20px 0;
}

.dlm-bracket-round {
    flex: 0 0 220px;
}

.dlm-bracket-round-title {
    font-size: 0.9rem;
    color: var(--dlm-primary);
    text-align: center;
    padding: 8px;
    background: var(--dlm-light);
    border-radius: var(--dlm-radius-sm);
    margin-bottom: 15px;
}

.dlm-bracket-match {
    background: var(--dlm-white);
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    margin-bottom: 15px;
    overflow: hidden;
}

.dlm-bracket-player {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--dlm-border);
    font-size: 0.85rem;
}

.dlm-bracket-player:last-child {
    border-bottom: none;
}

.dlm-bracket-player.dlm-winner {
    background: rgba(39, 174, 96, 0.08);
    font-weight: 700;
}

.dlm-bracket-score {
    font-weight: 700;
    min-width: 25px;
    text-align: center;
}

.dlm-bracket-status-completed {
    border-color: var(--dlm-success);
}

.dlm-bracket-status-pending {
    opacity: 0.6;
}

/* ==========================================================================
   Match Cards / Lists
   ========================================================================== */
.dlm-matches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dlm-match-card {
    background: var(--dlm-white);
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--dlm-transition);
}

.dlm-match-card:hover {
    box-shadow: var(--dlm-shadow);
}

.dlm-match-date {
    font-size: 0.85rem;
    color: var(--dlm-gray);
    min-width: 120px;
}

.dlm-match-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.dlm-own-team {
    color: var(--dlm-primary);
    font-weight: 700;
}

/* ==========================================================================
   Tabs (Frontend)
   ========================================================================== */
.dlm-tab-nav {
    display: flex;
    border-bottom: 2px solid var(--dlm-border);
    margin-bottom: 25px;
    gap: 0;
}

.dlm-tab-link {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--dlm-gray);
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--dlm-transition);
}

.dlm-tab-link:hover {
    color: var(--dlm-primary);
    text-decoration: none;
}

.dlm-tab-link.dlm-tab-active {
    color: var(--dlm-primary);
    border-bottom-color: var(--dlm-primary);
}

/* ==========================================================================
   Tournament Detail
   ========================================================================== */
.dlm-tournament-header h1 {
    color: var(--dlm-primary);
    margin-bottom: 20px;
}

.dlm-tournament-header .dashicons {
    color: var(--dlm-accent);
    vertical-align: middle;
}

.dlm-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    background: var(--dlm-white);
    padding: 25px;
    border-radius: var(--dlm-radius);
    box-shadow: var(--dlm-shadow);
}

.dlm-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.dlm-detail-item .dashicons {
    color: var(--dlm-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.dlm-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.dlm-login-box {
    background: var(--dlm-white);
    border-radius: var(--dlm-radius);
    box-shadow: var(--dlm-shadow);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.dlm-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.dlm-login-logo {
    max-width: 120px;
    margin-bottom: 15px;
}

.dlm-login-header h1 {
    font-size: 1.5rem;
    color: var(--dlm-primary);
    margin: 0 0 5px;
}

.dlm-login-header p {
    color: var(--dlm-gray);
    margin: 0;
    font-size: 0.9rem;
}

.dlm-login-message {
    padding: 12px 15px;
    border-radius: var(--dlm-radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.dlm-message-error {
    background: #fce4e4;
    color: var(--dlm-danger);
    border: 1px solid #f5c6c6;
}

.dlm-message-info {
    background: #e8f4f8;
    color: var(--dlm-info);
    border: 1px solid #bee5eb;
}

.dlm-form-group {
    margin-bottom: 20px;
}

.dlm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dlm-dark);
}

.dlm-form-group label .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
    color: var(--dlm-primary);
}

.dlm-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    font-size: 1rem;
    transition: var(--dlm-transition);
    box-sizing: border-box;
}

.dlm-input:focus {
    outline: none;
    border-color: var(--dlm-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.dlm-form-remember {
    display: flex;
    align-items: center;
}

.dlm-form-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
    margin-bottom: 0;
}

.dlm-login-links {
    text-align: center;
    margin-top: 15px;
}

.dlm-login-links a {
    color: var(--dlm-gray);
    font-size: 0.85rem;
    text-decoration: none;
}

.dlm-login-links a:hover {
    color: var(--dlm-primary);
    text-decoration: underline;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.dlm-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--dlm-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--dlm-transition);
    border: none;
    background: var(--dlm-primary);
    color: var(--dlm-white);
}

.dlm-btn:hover {
    background: var(--dlm-primary-light);
    color: var(--dlm-white);
    text-decoration: none;
}

.dlm-btn-primary {
    background: var(--dlm-primary);
    color: var(--dlm-white);
}

.dlm-btn-block {
    display: block;
    width: 100%;
}

.dlm-btn-secondary {
    background: var(--dlm-light);
    color: var(--dlm-dark);
}

.dlm-btn-secondary:hover {
    background: var(--dlm-border);
    color: var(--dlm-dark);
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dlm-dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--dlm-primary);
}

.dlm-dashboard-header h1 {
    color: var(--dlm-primary);
    margin: 0 0 5px;
}

.dlm-dashboard-role {
    color: var(--dlm-gray);
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dlm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.dlm-dashboard-card {
    background: var(--dlm-white);
    border-radius: var(--dlm-radius);
    box-shadow: var(--dlm-shadow);
    padding: 25px;
    border-top: 3px solid var(--dlm-primary);
}

.dlm-dashboard-card h3 {
    font-size: 1rem;
    color: var(--dlm-primary);
    margin: 0 0 15px;
}

.dlm-dashboard-card h3 .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

.dlm-dashboard-card .dlm-big-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dlm-primary);
    margin: 0;
    line-height: 1.2;
}

.dlm-card-wide {
    grid-column: span 2;
}

.dlm-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--dlm-radius);
    padding: 20px;
    color: #856404;
}

.dlm-mini-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.dlm-mini-stats div {
    text-align: center;
}

.dlm-mini-match {
    padding: 10px 0;
    border-bottom: 1px solid var(--dlm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dlm-mini-match:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Archive Page
   ========================================================================== */
.dlm-archive-title {
    font-size: 2rem;
    color: var(--dlm-primary);
    margin-bottom: 25px;
}

.dlm-archive-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 8px;
}

.dlm-pagination {
    margin-top: 30px;
    text-align: center;
}

.dlm-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: var(--dlm-radius-sm);
    text-decoration: none;
    color: var(--dlm-dark);
    background: var(--dlm-white);
    border: 1px solid var(--dlm-border);
    transition: var(--dlm-transition);
}

.dlm-pagination .page-numbers:hover,
.dlm-pagination .page-numbers.current {
    background: var(--dlm-primary);
    color: var(--dlm-white);
    border-color: var(--dlm-primary);
}

/* ==========================================================================
   Shortcode wrappers
   ========================================================================== */
.dlm-shortcode {
    margin: 20px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .dlm-container {
        padding: 15px 10px;
    }

    .dlm-team-header,
    .dlm-player-header,
    .dlm-location-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .dlm-match-scoreboard {
        flex-direction: column;
        gap: 15px;
    }

    .dlm-match-score {
        order: -1;
    }

    .dlm-lineups-grid {
        grid-template-columns: 1fr;
    }

    .dlm-team-grid,
    .dlm-league-grid,
    .dlm-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dlm-card-wide {
        grid-column: span 1;
    }

    .dlm-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dlm-table {
        font-size: 0.85rem;
    }

    .dlm-table thead th,
    .dlm-table tbody td {
        padding: 8px 10px;
    }

    .dlm-tab-nav {
        flex-wrap: wrap;
    }

    .dlm-tab-link {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .dlm-bracket {
        padding: 10px 0;
    }

    .dlm-bracket-round {
        flex: 0 0 180px;
    }

    .dlm-detail-grid {
        grid-template-columns: 1fr;
    }

    .dlm-location-image {
        flex: 0 0 auto;
    }

    .dlm-score-home,
    .dlm-score-away {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .dlm-stats-cards {
        grid-template-columns: 1fr;
    }

    .dlm-login-box {
        padding: 25px 20px;
    }
}

/* ==========================================================================
   Spielbericht – Schedule Overview ([dlm_spielbericht])
   ========================================================================== */
.dlm-spielbericht-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dlm-white);
    border-radius: var(--dlm-radius);
    overflow: hidden;
    box-shadow: var(--dlm-shadow);
    font-size: 0.9rem;
}

.dlm-spielbericht-table thead {
    background: var(--dlm-primary);
    color: var(--dlm-white);
}

.dlm-spielbericht-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dlm-spielbericht-table tbody tr {
    border-bottom: 1px solid var(--dlm-border);
    transition: var(--dlm-transition);
}

.dlm-spielbericht-table tbody tr:hover {
    background: rgba(30, 58, 95, 0.03);
}

.dlm-spielbericht-table tbody td {
    padding: 9px 14px;
    vertical-align: middle;
}

.dlm-spielbericht-table .dlm-col-spielnr {
    width: 55px;
    text-align: center;
    color: var(--dlm-gray);
    font-size: 0.82rem;
}

.dlm-spielbericht-table .dlm-col-teams {
    min-width: 200px;
}

.dlm-spielbericht-table .dlm-col-score {
    width: 80px;
    text-align: center;
    font-weight: 700;
}

.dlm-spielbericht-table .dlm-col-sets {
    width: 80px;
    text-align: center;
}

.dlm-spielbericht-table .dlm-col-actions {
    width: 180px;
    text-align: right;
    white-space: nowrap;
}

.dlm-spielbericht-day-header td {
    background: var(--dlm-light);
    color: var(--dlm-primary);
    font-weight: 700;
    padding: 8px 14px;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* Small action buttons in the schedule */
.dlm-btn-sm {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--dlm-radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--dlm-transition);
    margin-left: 4px;
    vertical-align: middle;
    background: var(--dlm-primary);
    color: var(--dlm-white);
}

.dlm-btn-sm:hover {
    background: var(--dlm-primary-light);
    color: var(--dlm-white);
    text-decoration: none;
}

.dlm-btn-sm.dlm-btn-secondary {
    background: var(--dlm-light);
    color: var(--dlm-dark);
    border: 1px solid var(--dlm-border);
}

.dlm-btn-sm.dlm-btn-secondary:hover {
    background: var(--dlm-border);
    color: var(--dlm-dark);
}

.dlm-btn-sm.dlm-btn-warning {
    background: var(--dlm-accent);
    color: var(--dlm-white);
}

.dlm-btn-sm.dlm-btn-warning:hover {
    background: #d68910;
    color: var(--dlm-white);
}

/* ==========================================================================
   Match Entry Form ([dlm_match_entry])
   ========================================================================== */
.dlm-entry-form-wrap {
    background: var(--dlm-white);
    border-radius: var(--dlm-radius);
    box-shadow: var(--dlm-shadow);
    padding: 30px;
    max-width: 960px;
}

.dlm-entry-form-wrap h2 {
    color: var(--dlm-primary);
    margin: 0 0 5px;
    font-size: 1.4rem;
}

.dlm-entry-form-wrap .dlm-match-meta-line {
    color: var(--dlm-gray);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.dlm-entry-section {
    margin-bottom: 30px;
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    overflow: hidden;
}

.dlm-entry-section-title {
    background: var(--dlm-primary);
    color: var(--dlm-white);
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.dlm-entry-section-body {
    padding: 16px;
}

/* Lineup grid – two equal columns */
.dlm-lineup-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dlm-lineup-col-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dlm-primary);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--dlm-primary);
}

.dlm-lineup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.dlm-pos-label {
    display: inline-block;
    min-width: 36px;
    padding: 3px 6px;
    background: var(--dlm-light);
    border-radius: var(--dlm-radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--dlm-primary);
    text-align: center;
    flex-shrink: 0;
}

.dlm-lineup-row select,
.dlm-lineup-row .dlm-input {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.88rem;
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    background: var(--dlm-white);
}

.dlm-lineup-row select:focus,
.dlm-lineup-row .dlm-input:focus {
    outline: none;
    border-color: var(--dlm-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

/* Results table inside entry form */
.dlm-results-entry-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.dlm-results-entry-table thead th {
    padding: 7px 10px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--dlm-gray);
    border-bottom: 1px solid var(--dlm-border);
}

.dlm-results-entry-table thead th.dlm-th-player {
    text-align: left;
    width: 30%;
}

.dlm-results-entry-table tbody tr {
    border-bottom: 1px solid var(--dlm-border);
}

.dlm-results-entry-table tbody tr:last-child {
    border-bottom: none;
}

.dlm-results-entry-table tbody td {
    padding: 8px 10px;
    vertical-align: middle;
}

.dlm-results-entry-table .dlm-td-player {
    font-size: 0.85rem;
    color: var(--dlm-dark);
}

.dlm-sets-cell {
    text-align: center;
}

.dlm-sets-cell select {
    width: 52px;
    padding: 5px 4px;
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    background: var(--dlm-white);
    cursor: pointer;
}

.dlm-sets-cell select:focus {
    outline: none;
    border-color: var(--dlm-primary);
}

.dlm-sets-sep {
    text-align: center;
    color: var(--dlm-gray);
    font-weight: 700;
    padding: 0 2px;
}

/* Player position selects in result rows */
.dlm-td-pos select {
    padding: 5px 8px;
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    font-size: 0.82rem;
    background: var(--dlm-white);
    max-width: 160px;
    width: 100%;
}

/* Game date field */
.dlm-entry-date-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.dlm-entry-date-row label {
    font-weight: 600;
    color: var(--dlm-dark);
    white-space: nowrap;
}

.dlm-entry-date-row input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    font-size: 0.95rem;
    background: var(--dlm-white);
    transition: var(--dlm-transition);
}

.dlm-entry-date-row input[type="date"]:focus {
    outline: none;
    border-color: var(--dlm-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Submit row */
.dlm-entry-submit-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Spinner inside button */
.dlm-btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--dlm-white);
    border-radius: 50%;
    animation: dlm-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes dlm-spin {
    to { transform: rotate(360deg); }
}

/* Notice / message box below form */
.dlm-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: var(--dlm-radius-sm);
    padding: 12px 16px;
    font-size: 0.9rem;
}

.dlm-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: var(--dlm-radius-sm);
    padding: 12px 16px;
    font-size: 0.9rem;
}

/* Read-only mode overlay hint */
.dlm-entry-readonly-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--dlm-radius-sm);
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: #5a4000;
}

/* ==========================================================================
   Einzelwertung (per-player stats in single match view)
   ========================================================================== */
.dlm-einzelwertung {
    margin-top: 30px;
}

.dlm-einzelwertung-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 15px;
}

.dlm-einzelwertung-group {
    background: var(--dlm-white);
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    overflow: hidden;
}

.dlm-einzelwertung-group-title {
    background: var(--dlm-light);
    color: var(--dlm-primary);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 14px;
    margin: 0;
    border-bottom: 1px solid var(--dlm-border);
}

.dlm-einzelwertung-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dlm-einzelwertung-table thead th {
    padding: 6px 10px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dlm-gray);
    border-bottom: 1px solid var(--dlm-border);
}

.dlm-einzelwertung-table thead th:first-child {
    text-align: left;
}

.dlm-einzelwertung-table tbody tr {
    border-bottom: 1px solid var(--dlm-border);
}

.dlm-einzelwertung-table tbody tr:last-child {
    border-bottom: none;
}

.dlm-einzelwertung-table tbody td {
    padding: 7px 10px;
    text-align: center;
    vertical-align: middle;
}

.dlm-einzelwertung-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--dlm-dark);
}

.dlm-einzelwertung-table .dlm-total-row td {
    background: var(--dlm-light);
    font-weight: 700;
    color: var(--dlm-primary);
    font-size: 0.82rem;
    text-transform: uppercase;
}

/* Win / loss coloring in Einzelwertung */
.dlm-win {
    color: var(--dlm-success);
    font-weight: 700;
}

.dlm-loss {
    color: var(--dlm-danger);
}

/* Entry link on match detail page */
.dlm-entry-link-box {
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(30, 58, 95, 0.04);
    border: 1px solid var(--dlm-border);
    border-radius: var(--dlm-radius-sm);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dlm-entry-link-box p {
    margin: 0;
    flex: 1;
    font-size: 0.9rem;
    color: var(--dlm-gray);
}

/* ==========================================================================
   Responsive – Spielbericht / Entry Form
   ========================================================================== */
@media (max-width: 768px) {
    .dlm-lineup-cols {
        grid-template-columns: 1fr;
    }

    .dlm-einzelwertung-groups {
        grid-template-columns: 1fr;
    }

    .dlm-spielbericht-table .dlm-col-sets,
    .dlm-spielbericht-table .dlm-col-spielnr {
        display: none;
    }

    .dlm-spielbericht-table .dlm-col-actions {
        width: auto;
    }

    .dlm-entry-form-wrap {
        padding: 16px;
    }

    .dlm-results-entry-table .dlm-td-pos {
        display: none;
    }

    .dlm-entry-submit-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .dlm-spielbericht-table .dlm-col-score {
        display: none;
    }

    .dlm-sets-cell select {
        width: 44px;
        padding: 4px 2px;
    }
}
