/* ============================================
   WORKING DRAFT LIST STYLES
   Fantasy Draft Board v4.0 - Player Watch List
   ============================================ */

/* ========== TOOLBAR BUTTON ========== */

.draft-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.draft-list-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.draft-list-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ef4444;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

/* ========== FLOATING WINDOW ========== */

.wdl-floating-window {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: var(--surface-color, #1a1a2e);
    border-radius: 10px;
    border: 1px solid var(--border-color, #2d2d4a);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 9000;
    overflow: hidden;
}

/* ========== WINDOW HEADER ========== */

.wdl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
}

.wdl-header-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wdl-icon {
    font-size: 1rem;
}

.wdl-title {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
}

.wdl-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.wdl-header-actions {
    display: flex;
    gap: 0.25rem;
}

.wdl-btn-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.wdl-btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== WINDOW BODY ========== */

.wdl-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ========== SEARCH ========== */

.wdl-search {
    position: relative;
}

.wdl-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #3d3d5c);
    border-radius: 6px;
    background: var(--input-bg, #252542);
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
}

.wdl-search input:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.wdl-search input::placeholder {
    color: var(--text-muted, #6b7280);
}

.wdl-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color, #1a1a2e);
    border: 1px solid var(--border-color, #2d2d4a);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.wdl-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wdl-search-result:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wdl-result-name {
    font-weight: 500;
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
}

.wdl-result-meta {
    color: var(--text-muted, #6b7280);
    font-size: 0.75rem;
}

.wdl-in-list {
    color: #10b981;
    font-weight: 600;
}

.wdl-no-results {
    padding: 0.75rem;
    color: var(--text-muted, #6b7280);
    font-size: 0.85rem;
    text-align: center;
}

/* ========== PLAYER LIST ========== */

.wdl-player-list {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
}

.wdl-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-size: 0.85rem;
    line-height: 1.5;
}

.wdl-section-divider {
    padding: 0.4rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted, #6b7280);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.wdl-player-row {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    background: var(--card-bg, #252542);
    transition: all 0.15s ease;
    gap: 0.5rem;
}

.wdl-player-row:hover:not(.drafted) {
    background: rgba(255, 255, 255, 0.05);
}

.wdl-player-row.drafted {
    opacity: 0.5;
    background: rgba(100, 100, 100, 0.1);
}

.wdl-player-rank {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color, #1a1a2e);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary, #a0a0b0);
    flex-shrink: 0;
}

.wdl-player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.wdl-player-name {
    font-weight: 500;
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wdl-player-name:hover {
    color: var(--accent-primary, #3b82f6);
}

.wdl-player-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
}

.wdl-position {
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.65rem;
}

/* Position colors */
.wdl-position.position-QB { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.wdl-position.position-RB { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.wdl-position.position-WR { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.wdl-position.position-TE { background: rgba(243, 156, 18, 0.2); color: #f39c12; }
.wdl-position.position-K { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.wdl-position.position-DEF { background: rgba(26, 188, 156, 0.2); color: #1abc9c; }

.wdl-team {
    color: var(--text-secondary, #a0a0b0);
}

.wdl-player-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.wdl-add-to-pick,
.wdl-remove-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.wdl-add-to-pick {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.wdl-add-to-pick:hover {
    background: #10b981;
    color: #fff;
}

.wdl-remove-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.wdl-remove-btn:hover {
    background: #ef4444;
    color: #fff;
}

.wdl-drafted-badge {
    padding: 0.15rem 0.4rem;
    background: rgba(100, 100, 100, 0.3);
    border-radius: 3px;
    font-size: 0.65rem;
    color: var(--text-muted, #6b7280);
}

/* ========== WINDOW FOOTER ========== */

.wdl-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d4a);
    background: var(--card-bg, #252542);
}

.wdl-btn-clear {
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid var(--border-color, #3d3d5c);
    border-radius: 4px;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wdl-btn-clear:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.wdl-footer-tip {
    font-size: 0.65rem;
    color: var(--text-muted, #6b7280);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 480px) {
    .wdl-floating-window {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 60vh;
        border-radius: 10px 10px 0 0;
    }
    
    .draft-list-btn span:not(.draft-list-badge) {
        display: none;
    }
}

/* ========== DRAFT LIST BUTTON IN CONTEXT BAR ========== */

#draftListBtn.context-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#draftListBtn.context-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
    transform: translateY(-1px);
}

#draftListBtn .btn-label {
    font-weight: 500;
}

#draftListBtn .draft-list-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hide label on smaller screens */
@media (max-width: 768px) {
    #draftListBtn .btn-label {
        display: none;
    }
}

/* ========== AVAILABLE PLAYERS SECTION ========== */

.wdl-section {
    display: flex;
    flex-direction: column;
}

.wdl-my-list-section {
    flex: 1;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wdl-available-section {
    border-top: 1px solid var(--border-color, #3d3d5c);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.wdl-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.wdl-section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wdl-section-icon {
    font-size: 0.7rem;
    color: var(--text-secondary, #9ca3af);
    transition: transform 0.2s ease;
}

.wdl-section-title {
    font-weight: 600;
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
}

.wdl-available-count {
    color: var(--text-secondary, #9ca3af);
    font-size: 0.8rem;
}

.wdl-available-content {
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Position Filters */
.wdl-position-filters,
.wdl-idp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.wdl-pos-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--input-bg, #252542);
    border: 1px solid var(--border-color, #3d3d5c);
    border-radius: 4px;
    color: var(--text-secondary, #9ca3af);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wdl-pos-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-primary, #3b82f6);
}

.wdl-pos-btn.active {
    background: var(--accent-primary, #3b82f6);
    border-color: var(--accent-primary, #3b82f6);
    color: #fff;
}

.wdl-idp-toggle {
    /* Same style as other buttons, just has arrow indicator */
}

.wdl-idp-filters {
    margin-top: 0.25rem;
}

/* Filter Row */
.wdl-filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wdl-available-search {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color, #3d3d5c);
    border-radius: 4px;
    background: var(--input-bg, #252542);
    color: var(--text-primary, #fff);
}

.wdl-available-search:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
}

.wdl-available-sort {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-color, #3d3d5c);
    border-radius: 4px;
    background: var(--input-bg, #252542);
    color: var(--text-primary, #fff);
    cursor: pointer;
}

/* Available Players List */
.wdl-available-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color, #3d3d5c);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.wdl-available-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.wdl-available-row:last-child {
    border-bottom: none;
}

.wdl-available-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wdl-available-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.wdl-available-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wdl-available-name:hover {
    color: var(--accent-primary, #3b82f6);
    text-decoration: underline;
}

.wdl-available-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-secondary, #9ca3af);
}

.wdl-pos {
    font-weight: 600;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.65rem;
}

.wdl-team {
    color: var(--text-secondary, #9ca3af);
}

.wdl-adp {
    color: var(--text-muted, #6b7280);
}

.wdl-add-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary, #3b82f6);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.wdl-add-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.wdl-add-btn.in-list {
    background: #22c55e;
    cursor: default;
}

.wdl-add-btn.in-list:hover {
    transform: none;
}

/* States */
.wdl-loading,
.wdl-error,
.wdl-no-players,
.wdl-more-players {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary, #9ca3af);
    font-size: 0.8rem;
}

.wdl-error {
    color: #ef4444;
}

.wdl-more-players {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-style: italic;
}

/* Position colors */
.wdl-pos.position-qb { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.wdl-pos.position-rb { background: rgba(34, 197, 94, 0.3); color: #86efac; }
.wdl-pos.position-wr { background: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.wdl-pos.position-te { background: rgba(249, 115, 22, 0.3); color: #fdba74; }
.wdl-pos.position-k, .wdl-pos.position-pk { background: rgba(168, 85, 247, 0.3); color: #d8b4fe; }
.wdl-pos.position-def, .wdl-pos.position-dst { background: rgba(107, 114, 128, 0.3); color: #d1d5db; }
.wdl-pos.position-dl, .wdl-pos.position-lb, .wdl-pos.position-db,
.wdl-pos.position-de, .wdl-pos.position-dt, .wdl-pos.position-cb, 
.wdl-pos.position-s, .wdl-pos.position-ed { 
    background: rgba(124, 58, 237, 0.3); 
    color: #c4b5fd; 
}

/* Adjust floating window height when available section is expanded */
.wdl-floating-window {
    max-height: calc(100vh - 100px);
}

.wdl-body {
    max-height: calc(100vh - 220px);
}

.wdl-load-more {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.wdl-load-more-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.wdl-load-more-btn:hover {
    background: #2563eb;
}

.wdl-total-count {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.wdl-injury-filter {
    padding: 0.4rem 0.5rem;
    border: 1px solid #4b5563;
    border-radius: 4px;
    background: #374151;
    color: #f9fafb;
    font-size: 0.8rem;
    min-width: 70px;
    cursor: pointer;
}

.wdl-injury-filter:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Adjust filter row for 3 items */
.wdl-filter-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    align-items: center;
}

.wdl-filter-row .wdl-available-search {
    flex: 1;
    min-width: 100px;
}