/* ==========================================================================
   Simple League Bracket Stylesheet (Modern Gentle White Theme)
   ========================================================================== */

.wp-league-container {
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --accent-color: #6366f1; /* Soft Indigo */
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --line-green: #06c755; /* Official LINE Green */
    --row-hover: #f8fafc;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    max-width: 100%;
    box-sizing: border-box;
    margin: 20px auto;
    position: relative;
}

.wp-league-container * {
    box-sizing: border-box;
}

/* Header */
.wp-league-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.wp-league-header h2 {
    font-size: 2rem;
    margin: 0 0 8px 0;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.wp-league-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Cards */
.league-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.league-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    color: var(--text-primary);
}

/* Form Controls */
#league-names-input {
    width: 100%;
    min-height: 160px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--border-radius-md);
    padding: 15px;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition-smooth);
}

#league-names-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Tab Navigation Styling */
.league-tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.league-tabs-nav .tab-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.league-tabs-nav .tab-btn:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
}

.league-tabs-nav .tab-btn.active {
    color: #fff;
    background: var(--accent-color);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Dashboard Layout */
.dashboard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-tabs-content {
    width: 100%;
}

.league-tab-panel {
    animation: fadeIn 0.25s ease-out;
}

/* Floating Toast Notification */
.toast-notification {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    pointer-events: none;
    transition: top 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-notification.visible {
    top: 30px;
    opacity: 1;
}

/* Standings Table Styles */
.standings-table-wrapper {
    overflow-x: auto;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.standings-table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.standings-table th, 
.standings-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.standings-table th {
    font-weight: 700;
    color: var(--text-secondary);
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.standings-table td {
    white-space: nowrap;
}

.standings-table tbody tr {
    transition: var(--transition-smooth);
}

.standings-table tbody tr:hover {
    background: var(--row-hover);
}

.standings-table td.col-name {
    font-weight: 700;
    color: var(--text-primary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column positioning */
.col-rank { width: 60px; text-align: center; font-weight: 700; }
.col-stat { width: 50px; text-align: center; color: var(--text-secondary); }
.col-points { width: 70px; text-align: center; font-weight: 800; color: var(--accent-color); }

/* Highlight top rankers */
.standings-table tbody tr:nth-child(1) .col-rank { color: #d97706; font-size: 16px; font-weight: 800; } 
.standings-table tbody tr:nth-child(2) .col-rank { color: #4b5563; font-weight: 800; } 
.standings-table tbody tr:nth-child(3) .col-rank { color: #b45309; font-weight: 800; } 

/* Matches Schedule List */
.matches-list-wrapper {
    width: 100%;
}

.league-round-group {
    margin-bottom: 25px;
    border-bottom: 1.5px dashed var(--border-color);
    padding-bottom: 15px;
}

.league-round-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.round-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-color);
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 15px;
    display: inline-block;
}

/* Match Score Card */
.league-match-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
    transition: var(--transition-smooth);
}

.league-match-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.06);
}

.match-team {
    font-weight: 700;
    font-size: 15px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-team.team-left {
    text-align: right;
    padding-right: 15px;
}

.match-team.team-right {
    text-align: left;
    padding-left: 15px;
}

/* Score Input area */
.match-score-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 110px;
    flex-shrink: 0;
}

.score-input {
    width: 44px;
    height: 34px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    transition: var(--transition-smooth);
    background: #fff;
}

.score-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.score-input[type=number] {
    -moz-appearance: textfield;
}

.score-divider {
    font-weight: 700;
    color: var(--text-secondary);
}

/* Bye matching */
.league-match-item.match-bye {
    background: #fdf4ff;
    border-style: dashed;
    border-color: #e9d5ff;
    color: #8b5cf6;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.helper-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: -10px;
    margin-bottom: 20px;
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
    background: #4f46e5;
}

.btn-danger {
    background: #fef2f2;
    color: var(--danger-color);
    border: 1.5px solid #fecaca;
}

.btn-danger:hover {
    background: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
}

.btn-line {
    background: var(--line-green);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(6, 199, 85, 0.2);
}

.btn-line:hover {
    background: #05b04b;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(6, 199, 85, 0.35);
}

.share-actions-group {
    display: inline-flex;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wp-league-container {
        padding: 15px;
    }

    .wp-league-header h2 {
        font-size: 1.6rem;
    }

    .dashboard-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .share-actions-group {
        width: 100%;
        display: flex;
    }

    .share-actions-group .btn {
        flex: 1;
    }

    .league-tabs-nav .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
        flex: 1;
        justify-content: center;
    }

    .setup-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }
}

/* Mobile scoring card collapses */
@media (max-width: 500px) {
    .league-match-item {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        text-align: center;
    }

    .match-team {
        width: 100% !important;
        white-space: normal;
    }

    .match-team.team-left {
        text-align: center;
        padding-right: 0;
    }

    .match-team.team-right {
        text-align: center;
        padding-left: 0;
    }

    .match-score-inputs {
        width: 100%;
        margin: 5px 0;
    }
}

/* Helper Utilities */
.hidden {
    display: none !important;
}
