
/* --- Dashboard Specific Styles --- */
.dashboard-grid { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; align-items: start; width: 100%; max-width: 1200px; padding: 0 2rem; box-sizing: border-box; }
.dashboard-nav { background-color: rgba(0, 0, 0, 0.4); padding: 1.5rem; border-radius: 8px; border: 1px solid #555; }
.dashboard-nav ul { list-style: none; padding: 0; margin: 0; }
.dashboard-nav .nav-item { display: block; padding: 12px 15px; margin-bottom: 10px; text-decoration: none; color: #ccc; font-weight: bold; border-radius: 5px; border-left: 4px solid transparent; transition: all 0.3s ease; cursor: pointer; background: none; border-right: none; border-top: none; border-bottom: none; text-align: left; width: 100%; font-size: 1em; }
.dashboard-nav .nav-item:hover { background-color: rgba(0, 170, 255, 0.1); color: #fff; }
.dashboard-nav .nav-item.active { color: #00ffaa; border-left-color: #00ffaa; background-color: rgba(0, 255, 170, 0.1); }
.dashboard-content { background-color: rgba(0, 0, 0, 0.4); padding: 2rem; border-radius: 8px; border: 1px solid #555; min-height: 50vh; }
.content-section { display: none; }
.content-section.active { display: block; }
.content-section h2 { font-size: 2.2rem; color: #00aaff; margin-top: 0; margin-bottom: 1.5rem; border-bottom: 2px solid #555; padding-bottom: 0.5rem; }
.golden-title { color: #FFC700 !important; }

/* === MODAL STYLES (Specific to Dashboard) === */

.modal-body { max-height: 60vh; overflow-y: auto; padding-right: 15px; }
.modal-footer { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #555; display: flex; justify-content: flex-end; gap: 1rem; }
.modal-footer.space-between { justify-content: space-between; }
.save-btn, .cancel-btn { padding: 10px 20px; border-radius: 5px; border: none; font-weight: bold; cursor: pointer; transition: all 0.3s; }
.save-btn { background-color: #28a745; color: white; }
.save-btn:hover { background-color: #218838; }
.cancel-btn { background-color: #6c757d; color: white; }
.cancel-btn:hover { background-color: #5a6268; }

/* Reset Confirmation Modal Specifics */
.warning-text { color: #dc3545; font-weight: bold; }
#btn-reset-confirm { background-color: #28a745; /* Green */ }
#btn-reset-confirm:hover { background-color: #218838; }
#btn-reset-cancel { background-color: #dc3545; /* Red */ }
#btn-reset-cancel:hover { background-color: #c82333; }


/* Load Layout Modal */
.load-game-list, .load-layout-list { list-style: none; padding: 0; }
.game-item, .load-layout-list li { background-color: rgba(255, 255, 255, 0.05); padding: 12px 15px; margin-bottom: 8px; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; border-left: 3px solid transparent; }
.game-item:hover, .load-layout-list li:hover { background-color: rgba(0, 170, 255, 0.2); border-left-color: #00aaff; }
.load-layout-list li { display: flex; justify-content: space-between; align-items: center; }
#btn-back-to-games { background: none; border: 1px solid #555; color: #ccc; padding: 8px 12px; border-radius: 5px; cursor: pointer; margin-bottom: 1rem; }
.layout-actions button { margin-left: 10px; }

/* Edit Splits Modal */
.split-editor-title { width: 100%; padding: 10px; margin-bottom: 1rem; background-color: #333; border: 1px solid #555; color: white; border-radius: 5px; box-sizing: border-box; }
.split-editor-list { list-style: none; padding: 0; }
.split-editor-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.split-name-input { flex-grow: 1; padding: 8px; background-color: #222; border: 1px solid #444; color: white; border-radius: 4px; }
.remove-split-btn { background-color: #dc3545; color: white; border: none; border-radius: 50%; width: 25px; height: 25px; cursor: pointer; font-weight: bold; }
#btn-add-split { width: 100%; margin-top: 10px; padding: 10px; background-color: #007bff; }

/* Hotkey Modal */
.hotkey-capture-box { padding: 2rem; border: 2px dashed #555; background-color: #222; text-align: center; font-size: 1.2rem; color: #ccc; border-radius: 8px; margin-top: 1rem; }

/* Save Run Details Modal */
.run-details-display p { margin: 5px 0; font-size: 1.1rem; }
.run-details-display p strong { color: #00ffaa; }
.final-time-display { font-size: 2rem; font-weight: bold; color: #FFC700; text-align: center; margin-top: 1rem; }

#speedrun-display-container { border: 1px solid #555; border-radius: 8px; padding: 1.5rem; background-color: rgba(0, 0, 0, 0.15); margin-bottom: 1.5rem; }
#speedrun-display-container h3 { margin-top: 0; margin-bottom: 1rem; color: #00ffaa; border-bottom: 1px solid #666; padding-bottom: 0.5rem; }
.main-timer-container { display: flex; justify-content: center; align-items: baseline; gap: 15px; padding: 1rem 0; }
.timer-segment { display: flex; flex-direction: column; align-items: center; }
.timer-number { font-size: 3rem; font-weight: bold; color: #fff; text-shadow: 0 0 8px #00ffaa, 0 0 15px #00ffaa; font-family: 'monospace'; line-height: 1; }
.timer-label { font-size: 0.9rem; color: #ccc; text-transform: uppercase; }
.timer-separator { font-size: 2.5rem; color: #888; padding-bottom: 15px; }

.splits-list-header { display: none; grid-template-columns: 1fr 100px 100px; gap: 15px; padding: 0 10px 10px 10px; border-bottom: 1px solid #666; font-weight: bold; color: #ccc; }
.splits-list-header.visible { display: grid; }
.splits-list-header > span { text-align: right; }
.splits-list-header > span:first-child { text-align: left; }

.splits-list { list-style: none; padding: 0; max-height: 300px; overflow-y: auto; }
.splits-list li { display: grid; grid-template-columns: 1fr 100px 100px; gap: 15px; align-items: center; padding: 10px; border-bottom: 1px solid #444; background-color: rgba(255, 255, 255, 0.05); border-radius: 4px; margin-bottom: 5px; }
.splits-list li.active-split { background-color: rgba(0, 170, 255, 0.2); border-left: 4px solid #00aaff; padding-left: 6px; }
.split-name { font-weight: bold; text-align: left; }
.split-comparison { font-family: monospace; font-size: 1.1em; color: #aaa; text-align: right; }
.split-time { font-family: monospace; font-weight: bold; font-size: 1.1em; text-align: right; }
.split-time.faster { color: #28a745 !important; } 
.split-time.slower { color: #dc3545 !important; }
.split-comparison.faster { color: #28a745 !important; }
.split-comparison.slower { color: #dc3545 !important; }


.new-timer-controls { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; align-items: stretch; margin-bottom: 1.5rem; }
.secondary-controls { display: grid; grid-template-rows: 1fr 1fr; gap: 1rem; }
.secondary-controls button { padding: 12px; font-size: 1rem; font-weight: bold; border-radius: 5px; cursor: pointer; border: none; transition: all 0.3s; color: white; width: 100%; }
.primary-control { display: grid; }
.primary-control button { padding: 12px; font-size: 2rem; font-weight: bold; border-radius: 8px; cursor: pointer; border: none; transition: all 0.3s; color: white; height: 100%; }
#btn-main-action { background-color: #28a745; }
#btn-main-action.is-running { background-color: #007bff; }
#btn-main-action.is-running:hover { background-color: #0056b3; }
#btn-main-action:hover { background-color: #218838; }
#btn-reset { background-color: #dc3545; }
#btn-reset:hover { background-color: #c82333; }
#btn-pause { background-color: #ffc107; color: #212529 !important; }
#btn-pause:hover { background-color: #e0a800; }

.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.actions-grid button { padding: 10px 20px; border: 1px solid #00aaff; background-color: rgba(0, 170, 255, 0.2); color: #fff; border-radius: 5px; cursor: pointer; transition: all 0.3s; }
.actions-grid button:hover { background-color: rgba(0, 170, 255, 0.4); box-shadow: 0 0 8px #00aaff; }

.remaining-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; border-top: 1px solid #555; padding-top: 1rem; }
.remaining-actions a { padding: 10px 20px; border: 1px solid #00aaff; background-color: rgba(0, 170, 255, 0.2); color: #fff; border-radius: 5px; text-decoration: none; text-align: center; transition: all 0.3s; }
.remaining-actions a:hover { background-color: rgba(0, 170, 255, 0.4); box-shadow: 0 0 8px #00aaff; }

.hotkey-settings-container { border-top: 1px solid #555; padding-top: 1.5rem; margin-top: 2rem; }
.hotkey-setting { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.hotkey-display { display: flex; align-items: center; gap: 10px; }
.hotkey-input { font-weight: bold; color: #00ffaa; }
.edit-hotkey-btn { padding: 4px 10px; font-size: 0.8em; background-color: #555; border: 1px solid #777; cursor: pointer; border-radius: 4px; }

/* --- Official Layouts Folder Management (Corrected) --- */
.layout-controls { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.folder-container { border: 1px solid #444; border-radius: 8px; margin-bottom: 1.5rem; background-color: rgba(255, 255, 255, 0.03); }

.folder-header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background-color: rgba(0, 0, 0, 0.2); border-bottom: 1px solid #444; border-radius: 8px 8px 0 0; }
.folder-header.no-toggle { padding: 1rem; } /* Restore padding for header without toggle */

.folder-title { display: flex; align-items: center; gap: 10px; }
.folder-header h3 { margin: 0; font-size: 1.2rem; color: #eee; }

.folder-toggle-btn { background: transparent; border: none; color: #ccc; cursor: pointer; padding: 5px; font-size: 1rem; transition: transform 0.2s ease-in-out; }
.folder-toggle-btn:hover { color: #00aaff; }

.folder-container.collapsed .folder-toggle-btn > i { transform: rotate(0deg); }
.folder-container:not(.collapsed) .folder-toggle-btn > i { transform: rotate(90deg); }

.folder-icon { color: #FFC700; font-size: 1.1rem; }

.folder-container.collapsed > .submission-list { display: none; }
.folder-container > .submission-list { padding: 1rem; border-top: none; margin: 0; }

.no-layouts-message p { padding: 1rem; color: #888; text-align: center; }

.action-btn { background-color: #6c757d; color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; }
.action-btn:hover { background-color: #5a6268; }

/* --- Leaderboard & Submission List Styles --- */

.back-to-menu-btn {
    background: none;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.back-to-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#leaderboard-title {
    font-size: 1.8rem;
    color: #eee;
    margin-bottom: 1rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.5rem;
}

.leaderboard-game-group {
    border: 1px solid #444;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background-color: rgba(255, 255, 255, 0.03);
}

.leaderboard-game-group summary {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1rem;
    cursor: pointer;
    outline: none;
    color: #FFC700;
}

.leaderboard-game-group .submission-list {
    padding: 0 1rem 1rem 1rem;
    margin:0;
    list-style-type: none;
}

.submission-list li {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 8px;
    border-radius: 5px;
    transition: background-color 0.3s;
    border-left: 3px solid transparent;
}
.submission-list li:hover {
     background-color: rgba(0, 170, 255, 0.1);
     border-left-color: #00aaff;
}


.submission-info-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem; /* row-gap and column-gap */
}
.submission-info-group > span,
.submission-info-group > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.layout-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #eee;
    flex-basis: 100%; /* Make layout name take full width */
}

/* Video Links Styling */
.video-links-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.video-link-button {
    padding: 3px 8px;
    border: 1px solid #00aaff;
    background-color: rgba(0, 170, 255, 0.2);
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85em;
    transition: all 0.3s;
}

.video-link-button:hover {
    background-color: rgba(0, 170, 255, 0.4);
    box-shadow: 0 0 5px #00aaff;
}

.no-video {
    color: #888;
    font-style: italic;
    font-size: 0.9em;
}
