﻿/* /admin/admin-styles.css */

main {
    max-width: 1000px;
}

#admin-container h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

#admin-container p {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.nav-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 180px;
}

    .nav-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

.nav-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.nav-card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.nav-card-description {
    font-size: 0.9rem;
    color: #666;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

    .filter-group label {
        font-weight: bold;
        margin-bottom: 0.5rem;
        display: block;
        color: #555;
    }

    .filter-group select {
        width: 100%;
        padding: 0.8rem;
        border: 1px solid #ccc;
        border-radius: 4px;
        background-color: #f9f9f9;
        color: #333;
        font-size: 1rem;
    }

.game-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background-color: #fff;
}

.game-details {
    flex-grow: 1;
}

.game-teams {
    font-size: 1.1rem;
}

.game-score {
    width: 150px;
    text-align: center;
    font-weight: bold;
    color: #555;
}

.btn-admin-primary,
.btn-admin-secondary,
.btn-admin-edit, 
.btn-admin-save, 
.btn-admin-delete {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-admin-primary {
    background-color: #007bff;
    color: white;
}
.btn-admin-primary:hover {
    background-color: #0056b3;
}
.btn-admin-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-admin-secondary:hover {
    background-color: #545b62;
}
.btn-admin-edit {
    background-color: #ffc107;
    color: #333;
}
.btn-admin-edit:hover {
    background-color: #e0a800;
}
.btn-admin-save {
    background-color: #28a745;
    color: white;
    width: 100%;
    margin-top: 1rem;
}
.btn-admin-save:hover {
    background-color: #218838;
}
.btn-admin-delete {
    background-color: #dc3545;
    color: white;
}
.btn-admin-delete:hover {
    background-color: #c82333;
}

.modal-admin {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-admin.is-visible {
    display: flex;
}

.modal-content-admin {
    background-color: #fefefe;
    margin: 0;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    color: #333;
    text-align: center;
}
.modal-content-admin h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #333;
}
.modal-content-admin p {
    margin-bottom: 1.5rem;
    color: #555;
}


.close-btn-admin {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.form-group-admin {
    margin-bottom: 1rem;
}
.form-group-admin label {
    display: block;
    margin-bottom: 0.5rem;
}
.form-group-admin input[type="number"],
.form-group-admin input[type="text"],
.form-group-admin input[type="date"],
.form-group-admin select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.search-container {
    margin-bottom: 2rem;
}

#player-search-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.player-entry, .team-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background-color: #fff;
}

.player-details, .team-details {
    display: flex;
    flex-direction: column;
}

.player-handle, .team-name {
    font-size: 1.1rem;
    font-weight: 500;
}

.player-sub-details, .team-sub-details {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.read-only-field {
    padding: 0.75rem;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}
.checkbox-group input {
    margin-right: 0.5rem;
}

.form-container-admin {
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.transaction-section {
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.transaction-section h4 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.trade-party-block {
    padding: 1rem;
    border: 1px dashed #ccc;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.assets-container {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #f0f0f0;
}

.asset-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.asset-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.asset-item span {
    font-weight: 500;
}

.btn-admin-add-asset {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-admin-remove-asset {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

.draft-table-container {
    overflow-x: auto;
}

.draft-table, .power-rankings-table, .schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.draft-table th, .draft-table td,
.power-rankings-table th, .power-rankings-table td,
.schedule-table th, .schedule-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
}

.draft-table th, .power-rankings-table th, .schedule-table th {
    background-color: #f2f2f2;
}

.draft-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.draft-table input[type="text"],
.draft-table select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.draft-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.draft-table td.read-only {
    font-weight: bold;
    background-color: #e9ecef;
    text-align: center;
}

.draft-table tr.is-forfeited {
    background-color: #f8d7da;
    text-decoration: line-through;
    color: #721c24;
}

.draft-table tr.is-forfeited input:not([type="checkbox"]),
.draft-table tr.is-forfeited select {
    background-color: #f1b0b7;
    pointer-events: none;
}

.awards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.awards-section, .schedule-section {
    background-color: #fff;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.awards-section h3, .schedule-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.team-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.player-list-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auto-award-display {
    background-color: #f0f2f5;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.auto-award-display p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.auto-award-display strong {
    color: #0056b3;
}

.power-rankings-table td {
    text-align: center;
}

.power-rankings-table td:first-child {
    text-align: left;
    font-weight: bold;
}

.power-rankings-table .rank-select {
    width: 80px;
    padding: 0.5rem;
}

.power-rankings-table .rank-change.positive {
    color: #28a745;
    font-weight: bold;
}

.power-rankings-table .rank-change.negative {
    color: #dc3545;
    font-weight: bold;
}

.power-rankings-table tr.has-duplicate .rank-select {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.validation-message {
    margin-top: 1rem;
    color: #dc3545;
    font-weight: bold;
    text-align: right;
}

.postseason-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.week-details, .round-details {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.week-summary, .round-summary {
    font-weight: bold;
    padding: 0.75rem;
    cursor: pointer;
    background-color: #f8f9fa;
    list-style: none;
}

.week-summary::-webkit-details-marker, .round-summary::-webkit-details-marker {
    display: none;
}

.week-summary:hover, .round-summary:hover {
    background-color: #e9ecef;
}

.week-details[open] .week-summary,
.round-details[open] .round-summary {
    border-bottom: 1px solid #ddd;
}

.round-date-inputs {
    padding: 1rem;
}

#system-status, #next-sample-display, #last-update-display {
    font-weight: bold;
}

#last-sample-log {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 1rem;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #212529;
}
#last-sample-log p {
    margin: 0;
    padding: 2px 0;
}

#writeup-container {
    margin-top: 2rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: none;
}

#writeup-output {
    width: 100%;
    height: 300px;
    font-family: monospace;
    white-space: pre-wrap;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 1rem;
    border-radius: 4px;
    color: #212529;
    resize: vertical;
}

.writeup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}
#progress-bar {
    width: 0%;
    height: 20px;
    background-color: #007bff;
    transition: width 0.2s ease-in-out;
}
#sample-progress-bar {
    background-color: #ffc107;
    transition: width 0.3s linear;
}

/* -------------------------------------- */
/* Dark Mode Specific Styles              */
/* -------------------------------------- */
.dark-mode .form-container-admin,
.dark-mode .game-entry,
.dark-mode .player-entry,
.dark-mode .team-entry,
.dark-mode .transaction-section,
.dark-mode .awards-section,
.dark-mode .schedule-section,
.dark-mode .filters-container,
.dark-mode #writeup-container {
    background-color: #2a2a2a;
    border-color: #444;
}

.dark-mode #admin-container p,
.dark-mode .nav-card-description,
.dark-mode .player-sub-details,
.dark-mode .team-sub-details,
.dark-mode .modal-content-admin p,
.dark-mode .description-text {
    color: #ccc;
}

.dark-mode .nav-card {
    background-color: #2a2a2a;
    border-color: #444;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}
.dark-mode .nav-card:hover {
    border-color: #90caf9;
}
.dark-mode .nav-card-icon {
    color: #90caf9;
}

.dark-mode .back-link {
    color: #90caf9;
}

.dark-mode .filter-group label {
    color: #bbb;
}
.dark-mode .filter-group select {
    background-color: #3a3a3a;
    border-color: #555;
    color: #eee;
}

.dark-mode .game-score {
    color: #ccc;
}

.dark-mode .modal-content-admin {
    background-color: #2a2a2a;
    border-color: #444;
    color: #eee;
}
.dark-mode .modal-content-admin h3 {
    color: #eee;
}

.dark-mode .form-group-admin input[type="number"],
.dark-mode .form-group-admin input[type="text"],
.dark-mode .form-group-admin input[type="date"],
.dark-mode .form-group-admin select {
    background-color: #3a3a3a;
    border-color: #555;
    color: #eee;
}

.dark-mode #player-search-input {
    background-color: #3a3a3a;
    border-color: #555;
    color: #eee;
}

.dark-mode .read-only-field {
    background-color: #3a3a3a;
    border-color: #555;
}

.dark-mode .trade-party-block {
    border-color: #555;
}
.dark-mode .assets-container {
    border-left-color: #444;
}
.dark-mode .asset-item {
    background-color: #3a3a3a;
}

.dark-mode .draft-table th, 
.dark-mode .power-rankings-table th, 
.dark-mode .schedule-table th {
    background-color: #3a3a3a;
}
.dark-mode .draft-table td, 
.dark-mode .power-rankings-table td, 
.dark-mode .schedule-table td,
.dark-mode .draft-table, 
.dark-mode .power-rankings-table, 
.dark-mode .schedule-table {
    border-color: #444;
}
.dark-mode .draft-table tr:nth-child(even) {
    background-color: #333;
}
.dark-mode .draft-table input[type="text"],
.dark-mode .draft-table select,
.dark-mode .power-rankings-table .rank-select {
    background-color: #444;
    border-color: #666;
    color: #eee;
}
.dark-mode .draft-table td.read-only {
    background-color: #444;
}
.dark-mode .draft-table tr.is-forfeited {
    background-color: #5d1c21;
    color: #f8d7da;
}
.dark-mode .draft-table tr.is-forfeited input:not([type="checkbox"]),
.dark-mode .draft-table tr.is-forfeited select {
    background-color: #721c24;
}

.dark-mode .transaction-section h4 {
    border-bottom-color: #444;
}

.dark-mode .awards-section h3, 
.dark-mode .schedule-section h3 {
    border-bottom-color: #444;
}

.dark-mode .auto-award-display {
    background-color: #3a3a3a;
}
.dark-mode .auto-award-display strong {
    color: #90caf9;
}

.dark-mode .power-rankings-table .rank-change.positive {
    color: #4caf50;
}
.dark-mode .power-rankings-table .rank-change.negative {
    color: #f44336;
}
.dark-mode .power-rankings-table tr.has-duplicate .rank-select {
    border-color: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.25);
}

.dark-mode .validation-message {
    color: #f44336;
}

.dark-mode .week-details, .dark-mode .round-details {
    border-color: #444;
}
.dark-mode .week-summary, .dark-mode .round-summary {
    background-color: #3a3a3a;
}
.dark-mode .week-summary:hover, .dark-mode .round-summary:hover {
    background-color: #444;
}
.dark-mode .week-details[open] .week-summary,
.dark-mode .round-details[open] .round-summary {
    border-bottom-color: #444;
}

.dark-mode #last-sample-log {
    background-color: #1e1e1e;
    border-color: #444;
    color: #e0e0e0;
}
.dark-mode #last-sample-log p {
    color: #ccc;
}
.dark-mode #last-sample-log p strong {
    color: #fff;
}

.dark-mode #writeup-output {
    background-color: #1e1e1e;
    border-color: #444;
    color: #f0f0f0;
}

.dark-mode #progress-bar-container {
    background-color: #444;
}
.dark-mode #progress-bar {
    background-color: #90caf9;
}
.dark-mode #sample-progress-bar {
    background-color: #ffd740;
}

@media (max-width: 600px) {
    main {
        padding: 1rem; /* Reduce padding on main content */
    }

    /* Reduce padding on admin containers */
    .form-container-admin,
    .filters-container,
    #writeup-container {
        padding: 1rem;
    }
    
    /* Reduce heading sizes */
    #scorekeeper-container h2 {
        font-size: 1.8rem;
    }

    /* Live Scoring Page: Stack the status grid */
    #system-status-grid {
        grid-template-columns: 1fr; /* Change from 2 columns to 1 */
        gap: 0.5rem;
    }

    #system-status-grid p {
        margin-bottom: 0.5rem;
    }

    /* Writeups Page: Stack the header */
    .writeup-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .writeup-header .btn-admin-edit {
        width: 100%;
        text-align: center;
    }
}

#admin-controls {
    /* Hidden by default, shown by JS when it has content */
    display: none;
    /* Use flexbox to center the buttons */
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Specific styles for buttons inside the controls container */
#admin-controls .edit-btn {
    padding: 10px 20px;
    text-decoration: none;
    font-size: 1rem;
    background-color: #007bff;
    /* Use !important to override general dark-mode link styles and ensure text is white */
    color: white !important; 
    border-radius: 6px;
    transition: background-color 0.3s ease;
    border: 1px solid #007bff;
}

#admin-controls .edit-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.dark-mode .lineup-modal .modal-content-admin {
    background-color: #2a2a2a;
    color: #eee;
}
.dark-mode .lineup-modal .team-lineup-section {
    background-color: #1e1e1e;
    border-color: #444;
}
.dark-mode .lineup-modal .team-lineup-section h4 {
    background-color: #333;
    border-bottom-color: #444;
    color: #eee;
}
.dark-mode .lineup-modal .roster-selection h5,
.dark-mode .lineup-modal .starters-entry h5 {
    color: #ddd;
}
.dark-mode .lineup-modal .roster-list {
    border-color: #444;
}
.dark-mode .lineup-modal .starter-card {
    background-color: #2c2c2c;
    border-color: #555;
}
.dark-mode .lineup-modal .starter-inputs input[type="number"] {
    background-color: #3a3a3a;
    border-color: #555;
    color: #eee;
}
.dark-mode .lineup-modal .team-score-summary {
    background-color: #003f7f;
    color: #d4eaff;
    border-color: #0056b3;
}

/* Add to /admin/admin-styles.css */

#report-output {
    white-space: normal; /* Allow the container to wrap content normally */
}

/* This targets the <pre> tag inside the lineups report specifically */
#report-output .report-item-text {
    white-space: pre-wrap; 
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #444;
}

.report-item:last-of-type {
    border-bottom: none;
}

.report-item > .report-item-text {
    flex-grow: 1;
    margin-right: 15px;
}

.copy-icon {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    user-select: none; /* Prevents text selection on double click */
}

.copy-icon:hover {
    background-color: #555;
}