/* NCAA Basketball Draft - Styles */

/* Reset confirmation modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-box h3 {
    font-size: 1.3em;
    margin-bottom: 12px;
    color: #c53030;
}

.modal-box p {
    color: #4a5568;
    margin-bottom: 12px;
    line-height: 1.5;
}

.modal-box input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
    outline: none;
}

.modal-box input:focus {
    border-color: #c53030;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-confirm-btn {
    background: #c53030;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: 600;
}

.modal-confirm-btn:disabled {
    background: #feb2b2;
    cursor: not-allowed;
}

.modal-confirm-btn:not(:disabled):hover {
    background: #9b2c2c;
}

.modal-cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: 600;
}

.modal-cancel-btn:hover {
    background: #cbd5e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 30px;
    font-size: 2.5em;
}

/* Notification Toast */
.notification {
    position: fixed;
    top: 20px; /* overridden dynamically by JS for stacking */
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.notification.error {
    background: #f56565;
}

.notification.warning {
    background: #744210;
    color: #fefcbf;
    font-weight: 600;
}

.notification.info {
    background: #4299e1;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Passcode Screen */
.passcode-screen {
    max-width: 500px;
    margin: 0 auto;
}

.passcode-info {
    background: #edf2f7;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #4a5568;
}

.passcode-info h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.passcode-info ul {
    margin-left: 20px;
    margin-top: 10px;
}

.passcode-info li {
    margin-bottom: 8px;
}

/* Setup Screen */
.setup-screen {
    max-width: 600px;
    margin: 0 auto;
    display: none;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.team-names {
    margin-top: 20px;
}

.team-input {
    margin-bottom: 12px;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    width: 100%;
    margin-top: 20px;
}

button:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    background: #e53e3e;
    margin-top: 10px;
    font-size: 14px;
}

.reset-btn:hover {
    background: #c53030;
}

.firebase-status {
    text-align: center;
    font-size: 0.9em;
    color: #48bb78;
    margin-top: -15px;
    margin-bottom: 20px;
}

.firebase-status.offline {
    color: #f56565;
}

.firebase-status.connecting {
    color: #ed8936;
}

.draft-room-info {
    text-align: center;
    font-size: 0.95em;
    color: #4a5568;
    margin-top: -10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #edf2f7;
    border-radius: 6px;
}

.draft-room-info strong {
    color: #667eea;
    font-size: 1.1em;
}

/* Draft Screen */
.draft-screen {
    display: none;
}

.draft-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.draft-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.current-pick {
    font-size: 1.5em;
    font-weight: 700;
}

.pick-details {
    font-size: 1.1em;
}

.pick-timer {
    font-size: 2em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    padding: 6px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    min-width: 80px;
    text-align: center;
}

.pick-timer.warning {
    background: rgba(237, 137, 54, 0.5);
}

.pick-timer.over {
    background: rgba(245, 101, 101, 0.6);
    animation: pulse 1s infinite;
}

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

.team-time {
    font-size: 0.85em;
    font-weight: 600;
    color: #718096;
    font-variant-numeric: tabular-nums;
    margin-right: 8px;
}

.team-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.constraint-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.constraint-status.met {
    background: rgba(72, 187, 120, 0.3);
}

.constraint-status.not-met {
    background: rgba(245, 101, 101, 0.3);
}

.draft-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

@media (max-width: 1024px) {
    .draft-content {
        grid-template-columns: 1fr;
    }
}

/* Player List */
.player-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
}

.search-box {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.search-box select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    white-space: nowrap;
}

.player-list {
    max-height: 600px;
    overflow-y: auto;
}

.player-table {
    width: 100%;
    border-collapse: collapse;
}

.player-table th {
    background: #2d3748;
    color: white;
    padding: 12px 8px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.player-table th:hover {
    background: #4a5568;
}

.player-table th.sortable::after {
    content: ' ⇅';
    opacity: 0.5;
    font-size: 0.9em;
}

.player-table th.sorted-asc::after {
    content: ' ▲';
    opacity: 1;
}

.player-table th.sorted-desc::after {
    content: ' ▼';
    opacity: 1;
}

.player-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e2e8f0;
}

.player-table tr:hover {
    background: #edf2f7;
}

.player-table tr.drafted {
    opacity: 0.5;
    background: #f1f1f1;
}

.draft-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    width: auto;
    margin: 0;
}

.draft-btn:hover {
    background: #38a169;
}

.draft-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.seed-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
}

.seed-high {
    background: #c6f6d5;
    color: #22543d;
}

/* Rosters */
.rosters-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.team-roster {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.team-roster.active {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.team-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #2d3748;
}

.roster-list {
    list-style: none;
}

.roster-list li {
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95em;
    color: #4a5568;
}

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

.pick-number {
    color: #a0aec0;
    font-size: 0.85em;
    margin-right: 8px;
}

.undo-btn {
    background: #f56565;
    padding: 10px 20px;
    font-size: 14px;
    margin-top: 10px;
    width: auto;
}

.undo-btn:hover {
    background: #e53e3e;
}

#exportBtn {
    background: #48bb78;
    margin-left: 10px;
}

#exportBtn:hover {
    background: #38a169;
}

.hidden {
    display: none;
}

.checkmark {
    color: #48bb78;
    font-weight: bold;
}

.warning {
    color: #f56565;
    font-weight: bold;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Team college tally */
.tally-wrapper {
    display: flex;
    gap: 20px;
}

.tally-col {
    flex: 1;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.tally-header {
    font-size: 1em;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

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

.tally-list li {
    padding: 4px 0;
    font-size: 0.9em;
    color: #4a5568;
    border-bottom: 1px solid #edf2f7;
}

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

.tally-seed {
    display: inline-block;
    background: #e2e8f0;
    color: #4a5568;
    font-size: 0.8em;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

.tally-empty {
    color: #a0aec0;
    font-size: 0.9em;
    font-style: italic;
}
