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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px;
}

header {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 12px;
}

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

header h1 {
    margin: 0;
    color: #1a1a1a;
    font-size: 22px;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.user-name {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.btn-login,
.btn-logout {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login {
    background-color: #4285f4;
    color: white;
}

.btn-login:hover {
    background-color: #357ae8;
}

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

.btn-logout:hover {
    background-color: #c82333;
}

.login-required {
    text-align: center;
    padding: 60px 20px;
}

.login-required h2 {
    color: #1a1a1a;
    margin-bottom: 15px;
    font-size: 24px;
}

.login-required p {
    color: #666;
    margin-bottom: 10px;
    font-size: 16px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.controls label {
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.controls select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    transition: background-color 0.2s;
}

.action-buttons button:hover {
    background-color: #0056b3;
}

.action-buttons button#resetDraftedBtn {
    background-color: #dc3545;
}

.action-buttons button#resetDraftedBtn:hover {
    background-color: #c82333;
}

#content {
    background: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 400px;
}

.placeholder {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-size: 16px;
}

.section {
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    font-size: 16px;
}

.section-header .count {
    font-weight: normal;
    color: #666;
    font-size: 14px;
}

.position-group {
    margin-bottom: 15px;
}

.position-group-header {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
    padding: 4px 0;
}

.players-grid {
    display: grid;
    gap: 8px;
}

.player-card {
    display: grid;
    grid-template-columns: 224px 100px 1fr 45px 45px 45px 45px 45px 45px 45px;
    gap: 4px;
    padding: 4px 6px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fafafa;
    font-size: 12px;
    align-items: center;
}

.player-card.prospects-card {
    /* Prospects page: Name, Price, Info, then prospect details (no stat columns) */
    grid-template-columns: 224px 100px 1fr;
}

.prospect-info-row {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: #555;
}

.prospect-info-row span {
    white-space: nowrap;
}

.prospect-info-row strong {
    color: #333;
    margin-right: 4px;
}

.stats-header-row {
    background-color: #e8e8e8;
    border: 2px solid #ccc;
    font-size: 10px;
    padding: 4px 6px;
    margin-bottom: 2px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.player-card.drafted {
    background-color: #d3d3d3;
    color: #1a1a1a;
}

.player-card:hover {
    background-color: #f0f0f0;
}

.player-card.drafted:hover {
    background-color: #c8c8c8;
}

.player-name {
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.player-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 0;
    max-width: 100%;
}

.drafted-indicator {
    flex-shrink: 0;
    white-space: nowrap;
}

.draft-team-display {
    flex-shrink: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 80px;
}

.drafted-indicator {
    color: #000;
    font-weight: bold;
    font-size: 14px;
}

.draft-team-display {
    font-weight: 600;
    font-size: 12px;
}

.player-price-column {
    display: flex;
    align-items: center;
}

.price-container {
    background-color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.edit-icon {
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
}

.edit-icon:hover {
    opacity: 1;
}

.player-price {
    font-weight: bold;
    color: #008000;
    font-size: 13px;
    min-width: 40px;
    outline: none;
}

.player-price:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-weight: normal;
}

.player-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.position-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #007bff;
    color: white;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}

.info-item {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
}

.info-label {
    font-weight: 600;
    margin-right: 4px;
}

.notes-icon {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    margin-left: 4px;
    display: inline-block;
    transition: opacity 0.2s, transform 0.2s;
}

.notes-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.player-notes-display {
    font-size: 11px;
    color: #1b5e20;
    font-style: normal;
    font-weight: 500;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 3px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    grid-column: 1 / -1;
}

.stats-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.stat-cell {
    text-align: center;
    font-size: 11px;
    color: #1a1a1a;
    padding: 1px 2px;
    min-width: 0;
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 12px;
    margin-top: 4px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    min-width: 0; /* Prevent overflow */
}

.stat-label {
    font-weight: 600;
    color: #555;
    min-width: 32px; /* Fixed width for labels to align values */
    text-align: right;
}

.stat-value {
    color: #1a1a1a;
    min-width: 40px; /* Fixed width for values to align across cards */
    text-align: left;
}

.no-players {
    text-align: center;
    color: #888;
    padding: 20px;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1a1a1a;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control textarea {
    resize: vertical;
    min-height: 120px;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-cancel:hover {
    background-color: #5a6268;
}

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

.btn-save:hover {
    background-color: #0056b3;
}

.notes-icon {
    cursor: pointer;
    font-size: 13px;
    opacity: 0.7;
    margin-left: 4px;
    display: inline-block;
    transition: opacity 0.2s, transform 0.2s;
    vertical-align: middle;
}

.notes-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

.player-notes-display {
    font-size: 10px;
    color: #1b5e20;
    font-style: normal;
    font-weight: 500;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 3px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    grid-column: 1 / -1;
    line-height: 1.4;
}

@media print {
    .controls,
    .action-buttons,
    #resetDraftedBtn,
    #exportDraftBtn,
    #importDraftBtn,
    #draftLogBtn {
        display: none;
    }
    
    .player-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}