/* In-House Component Styles - Matching MLB exactly */

.IH-dashboard {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    color: #ffffff;
    background-color: #1a1a1a;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.search-section {
    margin: 2rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    position: relative;
    display: inline-block;
}

.search-bar input {
    width: 300px;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #ffffff;
}

.search-bar input::placeholder {
    color: #888;
}

.suggestion-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 4px 4px;
    min-height: 0;
    max-height: 360px; /* allow up to ~10 names */
    overflow-y: auto;
    z-index: 2000;
    display: none;
    max-height: 70vh;
}

.suggestion-box div {
    padding: 8px 12px;
    cursor: pointer;
    color: #ffffff;
}

.suggestion-box div:hover {
    background-color: #3a3a3a;
}

.suggestion-box div.selected {
    background-color: #444;
}

.has-edger-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
}

.has-edger-filter input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #D4AF25;
    cursor: pointer;
}

.data-table {
    width: 100%;
    min-width: max-content;
    margin: 0;
    border-collapse: collapse;
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #444;
}

/* Override inline styles for better column sizing */
#pitchLogTable {
    table-layout: auto !important;
    width: auto !important;
}

.data-table th {
    background-color: #333;
    color: #fff;
    font-weight: bold;
}

.data-table tbody tr:hover {
    background-color: #3a3a3a;
}

.pitch-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
}

.plot-dropdown-container {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 2.5rem auto;
    text-align: center;
}

.plot-dropdown-container.show-dropdown {
    display: flex !important;
    margin: 2.5rem auto !important;
}

.plot-type-selector {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 1rem 3.5rem 1rem 1.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    color: #7bd6ff !important;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 55%),
                linear-gradient(160deg, #0d111a 0%, #131b2a 100%) !important;
    background-color: transparent !important;
    border: 2px solid #33bfff !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 24px rgba(51, 191, 255, 0.25) !important;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 260px !important;
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237bd6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1.5rem) 50%;
    background-size: 12px 8px;
}

.plot-type-selector:hover {
    border-color: #63e0ff !important;
    box-shadow: 0 14px 28px rgba(99, 224, 255, 0.35) !important;
    transform: translateY(-1px);
}

.plot-type-selector:focus {
    outline: none;
    border-color: #9bf0ff !important;
    box-shadow: 0 0 0 3px rgba(155, 240, 255, 0.25) !important;
}

.plot-type-selector option {
    background: #0d111a;
    color: #e0f7ff;
}

.plot-dropdown-container select.plot-type-selector {
    padding: 1rem 3.5rem 1rem 1.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #7bd6ff !important;
    border: 2px solid #33bfff !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 24px rgba(51, 191, 255, 0.25) !important;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 55%),
                linear-gradient(160deg, #0d111a 0%, #131b2a 100%) !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237bd6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1.5rem) 50%;
    background-size: 12px 8px;
}

@media (max-width: 640px) {
    .plot-dropdown-container {
        width: 100%;
    }
    .plot-type-selector {
        width: 100% !important;
        min-width: 0 !important;
    }
}

.date-range-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Pitch modal styles */
.ih-modal-overlay {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 100vh;
    background: rgba(5, 10, 18, 0.7);
    backdrop-filter: blur(4px);
    z-index: 3000;
    opacity: 0;
    animation: ih-modal-fade 0.2s ease-out forwards;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 5vh 0;
    box-sizing: border-box;
}

.ih-modal {
    position: relative;
    width: min(1040px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top, rgba(78, 130, 255, 0.12), transparent 60%),
                linear-gradient(180deg, #161c27 0%, #10141d 100%);
    border: 1px solid rgba(123, 214, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 22px 65px rgba(9, 14, 28, 0.55);
    color: #f3f7ff;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.96);
    animation: ih-modal-pop 0.22s ease-out forwards;
    cursor: default;
    margin: auto;
}

.ih-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px 12px;
}

.ih-modal-tags {
    display: flex;
    gap: 8px;
}

.ih-modal-tag {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 106, 86, 0.18);
    border: 1px solid rgba(255, 106, 86, 0.35);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ff9c88;
}

.ih-modal-tag.secondary {
    background: rgba(130, 205, 246, 0.16);
    border-color: rgba(130, 205, 246, 0.35);
    color: #a7ddff;
}

.ih-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(17, 23, 35, 0.85);
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.ih-modal-close:hover {
    transform: scale(1.05);
    background: rgba(32, 44, 65, 0.9);
}


.ih-modal-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 18px 32px 32px;
    overflow-y: auto;
}

.ih-modal-media {
    width: 100%;
}

.ih-modal-video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 45%;
    border-radius: 12px;
    background: rgba(6, 10, 18, 0.6);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.ih-modal-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ih-modal-video-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(9, 14, 23, 0.75);
}

.ih-modal-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ih-modal-player {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ih-modal-date {
    font-size: 0.9rem;
    color: rgba(223, 234, 255, 0.7);
}

.ih-modal-metrics {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ih-modal-metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 18, 31, 0.72);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.ih-modal-metrics-table th,
.ih-modal-metrics-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #f3f7ff;
}

.ih-modal-metrics-table th:first-child,
.ih-modal-metrics-table td:first-child {
    text-align: left;
    padding-left: 16px;
}

.ih-modal-metrics-table th {
    background: rgba(40, 62, 98, 0.6);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.ih-modal-metrics-table tbody tr:last-child td {
    border-bottom: none;
}

.ih-modal-metrics-table td {
    font-weight: 600;
}

.ih-modal-play-id {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(223, 234, 255, 0.75);
}

.ih-modal-play-id-label {
    font-weight: 600;
    letter-spacing: 0.03em;
}

.ih-modal-play-id-value {
    color: #f7fbff;
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 860px) {
    .ih-modal {
        width: min(720px, 96vw);
    }
    .ih-modal-body {
        padding: 16px 24px 28px;
    }
    .ih-modal-metrics-table th,
    .ih-modal-metrics-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 540px) {
    .ih-modal-header {
        padding: 16px 20px 10px;
    }
    .ih-modal-body {
        padding: 8px 20px 24px;
    }
    .ih-modal-metrics {
        overflow-x: auto;
    }
    .ih-modal-metrics-table {
        min-width: 520px;
    }
    .ih-modal-metrics-table th,
    .ih-modal-metrics-table td {
        white-space: nowrap;
    }
    .ih-modal-play-id {
        flex-direction: column;
        align-items: flex-start;
    }
    .ih-modal-tag {
        font-size: 0.72rem;
        padding: 4px 10px;
    }
    .ih-modal-close {
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
    }
}

@keyframes ih-modal-fade {
    to {
        opacity: 1;
    }
}

@keyframes ih-modal-pop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.date-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.date-input-group label {
    color: #ccc;
    font-size: 14px;
}

.date-input {
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #ffffff;
    font-size: 14px;
}

.date-input:focus {
    outline: none;
    border-color: #666;
    box-shadow: none;
}

.date-update-btn {
    padding: 8px 16px;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.date-update-btn:hover {
    background-color: #1976d2;
}

.date-update-btn:active {
    background-color: #1565c0;
}

.download-report-btn {
    position: fixed;
    top: calc(var(--navbar-offset, 70px) + 12px);
    right: clamp(16px, 3vw, 32px);
    padding: 10px 22px;
    background-color: #0f9d58;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    z-index: 1200;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.download-report-btn:hover {
    background-color: #128647;
}

.download-report-btn:disabled {
    cursor: default;
    background-color: #1a6c49;
    opacity: 0.65;
}

.download-report-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Loading Overlay - Matching MLB */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.loading-text {
    color: #ffffff;
    font-size: 1.2rem;
    margin-top: 1rem;
    font-weight: 500;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Plotly container styles */
.js-plotly-plot {
    width: 400px;
    height: 400px;
}

.js-plotly-plot .plotly {
    width: 100%;
    height: 100%;
}

.js-plotly-plot .plotly .main-svg {
    width: 100%;
    height: 100%;
}

/* Remove any transforms or transitions */
.js-plotly-plot, 
.js-plotly-plot .plotly, 
.js-plotly-plot .plotly .main-svg {
    transform: none !important;
    transition: none !important;
}

/* Location and Movement Plots */
.location-plot,
.movement-plot {
    margin: 10px;
    background: #222;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.location-plot canvas,
.movement-plot canvas {
    border-radius: 4px;
    background: #333;
    display: block;
    margin: 0 auto;
}

.location-plot-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

#locationPlotContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 2em auto;
    max-width: 1200px;
    padding: 0 20px;
}

/* Pitch Log Table Styles */

.pitch-log-wrapper {
    margin: 2em auto;
}

.pd-ih-wrapper {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.pd-ih-pitch-type-section {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
}

.pd-ih-pitch-type-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.pd-ih-pitch-type-label {
    color: #ffffff;
    font-weight: 600;
}

.pd-ih-pitch-type-message {
    color: #bbbbbb;
    font-size: 0.95rem;
}

.pd-ih-pitch-type-message.loading {
    color: #dddddd;
}

.pd-ih-pitch-type-message.warning {
    color: #ffbb55;
}

.pd-ih-pitch-type-message.error {
    color: #ff6666;
}

.pitch-log-wrapper .table-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 5px;
    margin: 5px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    width: fit-content;
    max-width: 90%;
}

.pitch-log-wrapper .clean-title {
    color: #fff;
    text-align: center;
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.pitch-log-container {
    width: fit-content;
    margin: 0 auto;
    overflow-x: auto;
}

.table-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entries-control label,
.search-control label {
    color: #fff;
    margin-right: 10px;
}

.entries-control select,
.search-control input {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 4px 8px;
}

.entries-control span {
    color: #ccc;
    margin-left: 10px;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
    background: #333;
    border-radius: 4px;
}

.pagination button {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 0 4px;
    cursor: pointer;
}

.pagination button:hover:not(:disabled) {
    background: #555;
}

.pagination button:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.pagination button[style*="background: #007bff"] {
    background: #007bff !important;
    border-color: #007bff !important;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background-color: #444 !important;
}

.sortable-header.sort-asc::after {
    content: " ▲";
    color: #2196f3;
}

.sortable-header.sort-desc::after {
    content: " ▼";
    color: #2196f3;
}

.pitch-log-wrapper .data-table td:empty::before {
    content: "-";
    color: #666;
}

.pitch-log-wrapper .data-table td:first-child {
    text-align: left;
    font-weight: bold;
    color: #2196f3;
}

.pitch-averages-container .table-container {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 0;
  margin: 0 auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  width: fit-content;
  max-width: 90%;
}

/* Hard-center the pitch averages group regardless of parent layout */
.pitch-averages-container { display: flex; justify-content: center; }
.pitch-averages-container .table-container,
.pitch-averages-container .pitch-metrics-container,
.pitch-averages-container .data-table {
  margin-left: auto !important;
  margin-right: auto !important;
}
.pitch-averages-container .pitch-metrics-container { display: inline-block; }

/* Add MLB/MiLB style metrics wrapper for robust centering */
.metrics-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
}

.pitch-averages-container .clean-title {
    color: #fff;
    text-align: center;
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
    background-color: #333;
    padding: 10px;
    border-radius: 8px 8px 0 0;
}

.pitch-averages-container .pitch-metrics-container {
    /* Let the wrapper size to the actual table width for perfect centering */
    width: fit-content !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: inline-block;
}

/* Ensure a wrapper can center based on content width like MLB */
.pitch-averages-container .table-wrapper { width: max-content; margin: 0 auto; }

.pitch-averages-container .data-table th[colspan] {
    background-color: #333;
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 12px 15px;
    border: 1px solid #444;
}

.pitch-averages-container .data-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #444;
    background-color: #2a2a2a;
    color: #fff;
}

/* Plot Controls */
.plot-controls {
    margin: 2em auto;
    text-align: center;
}

/* VAA and HAA column styling - make them dynamically sized based on content */
.pitch-log-wrapper .data-table th:nth-child(13),
.pitch-log-wrapper .data-table td:nth-child(13),
.pitch-log-wrapper .data-table th:nth-child(14),
.pitch-log-wrapper .data-table td:nth-child(14) {
    width: auto !important;
    min-width: 45px !important;
    max-width: 70px !important;
    white-space: nowrap;
    text-align: center;
    padding: 8px 2px !important;
}

/* Ensure VAA and HAA columns have equal width and adapt to content */
.pitch-log-wrapper .data-table th:nth-child(13),
.pitch-log-wrapper .data-table td:nth-child(13) {
    width: auto !important;
    min-width: 45px !important;
    max-width: 70px !important;
}

.pitch-log-wrapper .data-table th:nth-child(14),
.pitch-log-wrapper .data-table td:nth-child(14) {
    width: auto !important;
    min-width: 45px !important;
    max-width: 70px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .date-range-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-bar input {
        width: 250px;
    }
} 
