/* app/static/components.css */
/* --- Picks Input Component --- */
.upcoming-picks-section {
    max-width: 600px;
    margin: 20px auto;
}

.pick-row {
    border: none;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    /* position: relative; <-- REMOVED to stop every row from creating a stacking context */
    background-color: #f9f9f9;
}

/* LIFT THE ENTIRE ACTIVE ROW to ensure its autocomplete list appears above subsequent rows. */
/* ONLY the active row becomes a positioned container */
.pick-row.autocomplete-active {
    position: relative;
    z-index: 10;
}

.pick-row.disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

.pick-input-container {
    flex-grow: 1;
    /* position: relative; <-- REMOVED so the autocomplete list is relative to the .pick-row */
}

.pick-input {
    width: 100%;
    border: none;
    background-color: transparent;
    padding: 0;
    box-sizing: border-box;
    font-size: 1.2em;
    font-weight: 600; /* BOLD */
    text-align: center;
}

.pick-input::placeholder {
    text-align: left;
    font-weight: normal;
}

.pick-row.disabled .pick-input {
    border: none;
    background-color: transparent;
}
.pick-input:focus {
    outline: none;
    border-bottom: 1px solid #007bff;
}

.pick-input-display {
    width: 100%;
    border: none;
    background-color: transparent;
    padding: 0;
    box-sizing: border-box;
    font-size: 1.2em;
    font-weight: 600; /* BOLD */
    text-align: center;
    padding-top: 4px; /* Align text vertically with the input field */
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #ccc;
    border-top: none;
    background-color: white;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}
.autocomplete-list-item {
    padding: 8px;
    cursor: pointer;
}
.autocomplete-list-item:hover {
    background-color: #f0f0f0;
}
.trash-icon {
    font-size: 1.5em;
    cursor: pointer;
    margin-left: 10px;
}

/* --- Picks Status/Feedback Components --- */
#congratulations-message {
    text-align: center;
    padding: 20px;
    border: 2px solid #3cb371;
    border-radius: 5px;
    background-color: #e6ffe6;
    margin-top: 20px;
}

.empty-picks-box {
    max-width: 600px;
    margin: 20px auto;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    font-size: 1.2em;
    color: #666;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.picks-status-message {
    font-size: 0.9em;
    color: #666;
    margin-top: 15px;
    text-align: center;
    position: relative; /* Needed for the highlighter pseudo-element */
    isolation: isolate; /* Create a new stacking context */
}

/* Highlighter animation for the status message */
@keyframes highlight-and-erase {
    0% { transform: scaleX(0); transform-origin: left; }
    20% { transform: scaleX(1); transform-origin: left; } /* Highlight wipe */
    80% { transform: scaleX(1); transform-origin: right; } /* Hold */
    100% { transform: scaleX(0); transform-origin: right; } /* Erase wipe */
}

.picks-status-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 0, 0.4); /* Highlighter yellow */
    z-index: -1; /* Place it behind the text */
    /* Total animation is 5s: 1s wipe, 3s hold, 1s erase. Total cycle time is 6s with 1s pause at end */
    animation: highlight-and-erase 5s linear 1s infinite;
}


.picks-status-message-user {
    font-size: 1.0em;
    color: #666;
    text-align: center;
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    background-color: #f4f4f4;
}

.picks-message-box {
    background-color: #e6ffe6;
    border: 2px solid #3cb371;
    border-radius: 5px;
    text-align: center;
    padding: 15px;
    font-weight: 600; /* BOLD */
    margin: 20px 0;
}

/* --- Modal Component --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px 40px 30px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    max-width: 500px;
    width: 90%;
}

.modal-close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: 600; /* BOLD */
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

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

/* --- Cascade of Names Component --- */
.names-cascade-container {
    position: relative;
    width: 100%;
    background-color: #f0f0f0;
    overflow: hidden;
    border: 1px solid #ccc;
    box-sizing: border-box;
    border-radius: 8px;
}

.falling-name {
    position: absolute;
    white-space: nowrap;
    user-select: none;
    animation-name: fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes fall {
    from { /* top is set dynamically via JS */ }
    to { top: 105%; }
}

/* --- Person Hover Info Panel Component --- */
#person-info-panel {
    position: absolute;
    background-color: #ffffff;
    border: 1px solid #333333;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 300px;
    pointer-events: none; /* Prevents the panel from interfering with mouse events */
    font-size: 13px;
    line-height: 1.4;
}

#person-info-panel .panel-descriptor {
    font-style: italic;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

#person-info-panel .panel-detail {
    margin-top: 5px;
}

/* --- Rainbow Glow Effect Component --- */
@property --angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
@property --radius {
    syntax: '<length>';
    inherits: false;
    initial-value: 8px;
}
@property --thickness {
    syntax: '<length>';
    inherits: false;
    initial-value: 5px; /* Controls how far the glow extends */
}

.widget-box.rainbow-border {
    position: relative; /* Ensures the pseudo-element is positioned correctly */
    isolation: isolate; /* Creates a new stacking context to contain the z-index glow */
}

.widget-box.rainbow-border::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff; /* Match the widget's intended background */
    border-radius: inherit; /* Inherit border-radius from .widget-box */
    z-index: -1; /* Sits behind the content, but in front of the glow */
}

.widget-box.rainbow-border::after {
    content: "";
    position: absolute;
    z-index: -2; /* Pushed behind the new ::before background shield */
    top: calc(-1 * var(--thickness));
    left: calc(-1 * var(--thickness));
    right: calc(-1 * var(--thickness));
    bottom: calc(-1 * var(--thickness));
    background: conic-gradient(from var(--angle),
        #ff004c, #ff7a00, #ffd400, #46ff00, #00d5ff, #008cff, #b500ff, #ff004c
    );
    filter: blur(15px); /* Controls the softness of the glow */
    border-radius: calc(var(--radius) + var(--thickness));
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to { --angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
    .widget-box.rainbow-border::after {
        animation: none;
    }
}

/* --- Wikipedia Side Panel Component --- */
.side-by-side-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: flex-start;
}

.side-by-side-container .form-container {
    flex: 1;
    max-width: 450px; /* Adjust width for side-by-side */
    margin: 0; /* Override margin:auto */
}

#wikipedia-panel {
    flex: 1;
    max-width: 600px; /* Wider panel for content */
    height: 700px; /* Make it taller to match form height */
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #fff;
    overflow-y: scroll; /* Enable vertical scrolling */
}

#wikipedia-panel-content {
    padding: 20px;
}

#wikipedia-panel-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

#wikipedia-panel-content .infobox {
    margin: 0 0 1em 1em;
    float: right;
    clear: right;
}

#wikipedia-panel-content table {
    max-width: 100%;
    border-collapse: collapse;
}

#wikipedia-panel-content th, #wikipedia-panel-content td {
    border: 1px solid #ddd;
    padding: 4px;
    font-size: 0.9em;
}