/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent zoom on mobile devices */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    min-height: 100vh;
}

/* Status Bar */
.status-bar {
    background: #2c3e50;
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.status-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.round-indicator {
    position: absolute;
    left: 30px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #28a745, #20c997);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    min-width: 80px;
    text-align: center;
}

.draft-status {
    font-size: 18px;
    font-weight: bold;
}

.draft-controls {
    display: flex;
    gap: 10px;
    position: absolute;
    right: 0;
}

/* Main Container */
.main-container {
    display: grid;
    grid-template-columns: 350px 1fr 300px;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

/* Column Styles */
.teams-column,
.players-column,
.picks-column {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.teams-column {
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    z-index: 2000;
}

.column-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h2 {
    font-size: 18px;
    margin: 0;
}

.team-controls {
    display: flex;
    gap: 10px;
}

/* Teams Column */
.teams-list {
    padding: 10px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.team-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.team-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.team-card.current-turn {
    border-color: #28a745;
    background: #d4edda;
}

.team-card.no-money {
    opacity: 0.6;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
}

.team-info {
    flex: 1;
}

.team-name {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.team-budget {
    color: #28a745;
    font-weight: bold;
    font-size: 18px;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    text-align: center;
    min-width: 60px;
}

.team-roster {
    font-size: 12px;
    color: #6c757d;
}

.team-roster span {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px;
    background: #e9ecef;
    border-radius: 4px;
}

/* Players Column */
.player-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gear-menu {
    position: relative;
    display: inline-block;
}

.gear-btn {
    padding: 8px 12px;
    font-size: 16px;
}

.gear-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 180px;
}

.gear-dropdown.show {
    display: block;
}

.gear-option {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.gear-option:hover {
    background: #f5f5f5;
}

.gear-option:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.gear-option:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 150px;
}

.search-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding-right: 30px;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.filter-select {
    min-width: 120px;
}

.players-list {
    padding: 15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.player-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-card:hover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: translateX(3px);
}

.player-card.drafted {
    opacity: 0.5;
    background: #f8f9fa;
    cursor: not-allowed;
}

.player-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.player-name-team {
    font-size: 14px;
    font-weight: normal;
    color: #2c3e50;
    margin-bottom: 2px;
}

.player-details-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.player-value-large {
    font-size: 16px;
    font-weight: bold;
    color: #28a745;
    background: #d4edda;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #c3e6cb;
}

.player-status-points {
    font-size: 11px;
    color: #6c757d;
    text-align: right;
}

.player-bye-week {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    padding-right: 8px;
}



.player-status {
    color: #dc3545;
    font-weight: bold;
}

.player-points {
    color: #6c757d;
}

/* Picks Column */
.picks-list {
    padding: 15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.pick-item {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
}

.pick-player {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.pick-details {
    font-size: 12px;
    color: #6c757d;
}

.pick-value {
    color: #28a745;
    font-weight: bold;
}

/* Round separators and headers */
.round-separator {
    height: 2px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 15px 0;
}

.round-header {
    background: #34495e;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    margin: 10px 0 8px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Bid increment/decrement buttons - iPad optimized */
.bid-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

.bid-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 60px;
    min-height: 60px;
    
    /* Prevent zoom on rapid tapping */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
}

.bid-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.bid-btn:active {
    transform: scale(0.95);
}

.bid-btn.decrement {
    background: #dc3545;
    color: white;
}

.bid-btn.increment {
    background: #28a745;
    color: white;
}

/* Highest bidder highlight */
.team-card.highest-bidder {
    position: relative;
    border: 3px solid #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.team-card.highest-bidder::after {
    content: "⭐";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 24px;
    background: #ffc107;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-actions .btn {
    min-width: 100px;
}

/* Team Options Modal */
#teamOptionsInfo {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

#teamRosterSnapshot {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.team-roster-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.team-roster-item:last-child {
    border-bottom: none;
}

.roster-player-info {
    flex: 1;
}

.roster-player-name {
    font-weight: bold;
    color: #2c3e50;
}

.roster-player-details {
    font-size: 12px;
    color: #6c757d;
}

.roster-player-bid {
    font-weight: bold;
    color: #28a745;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

/* Bidding modal should be less intrusive so teams can see their budgets */
#biddingModal {
    background-color: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}

/* Export modal should frost everything including teams column */
#exportModal {
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    z-index: 3000;
}

/* Alert modal should appear above all other modals */
#alertModal {
    z-index: 4000;
}

/* Export modal content should be scrollable */
#exportContent {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: #34495e;
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Bidding Styles */
.current-bid {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 3px solid #1976d2;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.current-bid strong {
    font-size: 24px;
    color: #0d47a1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: block;
    margin-bottom: 8px;
}

.current-bid div {
    font-size: 16px;
    color: #1565c0;
    font-weight: 500;
}

.bidding-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.bid-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bid-label {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    text-align: center;
    display: block;
}

.bid-team-select {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #007bff;
    border-radius: 6px;
    background: white;
    min-width: 200px;
}

.bid-amount-input {
    padding: 12px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #28a745;
    border-radius: 6px;
    text-align: center;
    min-width: 150px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
}

.award-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.nomination-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
    align-items: center;
}

.export-content {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    white-space: pre-line;
    max-height: 500px;
    overflow-y: auto;
}

.export-team {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
    margin-top: 15px;
}

.export-team:first-child {
    margin-top: 0;
}

.export-player {
    margin-left: 20px;
    margin-bottom: 4px;
    color: #34495e;
}

.award-confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.award-confirm-info {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.award-confirm-player {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.award-confirm-details {
    font-size: 16px;
    color: #34495e;
    line-height: 1.5;
}

/* Budget Color Classes */
.budget-green {
    color: #27ae60 !important;
    font-weight: bold;
}

.budget-yellow {
    color: #f39c12 !important;
    font-weight: bold;
}

.budget-orange {
    color: #e67e22 !important;
    font-weight: bold;
}

.budget-red {
    color: #e74c3c !important;
    font-weight: bold;
}

/* Player Value Color Classes */
.value-green {
    color: #27ae60 !important;
    font-weight: bold;
}

.value-yellow {
    color: #f39c12 !important;
    font-weight: bold;
}

.value-gray {
    color: #7f8c8d !important;
    font-weight: bold;
}



/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 300px 1fr 250px;
    }
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .teams-column,
    .players-column,
    .picks-column {
        position: static;
        max-height: 400px;
    }
    
    .status-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .round-indicator {
        position: static;
        margin-bottom: 10px;
        font-size: 18px;
        padding: 8px 16px;
        min-width: 80px;
    }
    
    .draft-controls {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .main-container {
        padding: 10px;
        gap: 10px;
    }
    
    .column-header {
        padding: 10px 15px;
    }
    
    .teams-list,
    .players-list,
    .picks-list {
        padding: 10px;
    }
    
    .player-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        min-width: auto;
    }
    
    .bidding-controls {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Status Indicators */
.status-dtd { color: #ffc107; }
.status-ir { color: #dc3545; }
.status-sus { color: #6f42c1; }
.status-pup { color: #fd7e14; }

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
