/* Dashboard Container */
#rally-dashboard {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Form Card */
.rally-form-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.rally-form-card label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    margin-top: 15px;
}

.rally-form-card select,
.rally-form-card input[type="text"],
.rally-form-card textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.rally-input-group {
    display: flex;
    gap: 10px;
}

.rally-input-group input {
    flex-grow: 1;
}

/* Admin Styles */
.rally-admin-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.rally-show-block {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #2271b1;
}

.rally-recycle {
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 10px;
    opacity: 0.5;
}
.rally-recycle:hover {
    opacity: 1;
}

/* V2 Dashboard */
#rally-dashboard-v2 {
    width: 100%; /* Full Width */
    margin: 0;
}

.rally-accordion-group {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.rally-accordion-header {
    background: #f8f9fa;
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    user-select: none;
}
.rally-accordion-header:hover { background: #eee; }

.rally-accordion-content {
    display: none;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

/* Flex Row Container - Adds spacing and a divider line */
.rally-segment-row {
    margin-bottom: 40px;          /* Large gap between segments */
    padding-bottom: 30px;         /* Breathing room inside the block */
    border-bottom: 4px solid #f0f0f1; /* Thick grey divider line */
}

/* Remove divider from the very last item so it looks clean */
.rally-segment-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Segment Header Styling - Solid Admin Bar */
.rally-segment-row label {
    display: block;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;               /* White Text for contrast */
    background: #3c434a;          /* WordPress "Dark Grey" (Matches Admin Sidebar) */
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Slight lift */
    border: none;                 /* No cheap borders */
}

.rally-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.rally-quick-input {
    flex-grow: 1; /* Takes up all available space */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    transition: border 0.2s;
    line-height: 1.4;
}
.rally-quick-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}
.rally-add-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    background: #f0f0f1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rally-add-btn:hover {
    background: #e5e5e5;
    border-color: #999;
}

/* Stacking Toasts */
#rally-toast-container {
    position: fixed;
    top: 50px; /* Below admin bar usually */
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Let clicks pass through */
}

.rally-toast-item {
    padding: 12px 24px;
    color: #fff;
    border-radius: 4px;
    background: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateX(20px);
}

@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}

.rally-toast-item.info { background: #2271b1; }
.rally-toast-item.success { background: #00a32a; }
.rally-toast-item.error { background: #d63638; }

/* Toast */
#rally-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    display: none;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#rally-toast.info { background: #2271b1; }
#rally-toast.success { background: #00a32a; }
#rally-toast.error { background: #d63638; }

/* Entry Lists */
.rally-entries-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rally-entry {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* My Entries */
.rally-mine {
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
}

/* Others Entries */
.rally-others {
    background: #f6f7f7;
    border-left: 3px solid #ccc;
    color: #666;
    opacity: 0.8;
}

.rally-entry-content p {
    margin: 2px 0 0 0;
    font-size: 0.9em;
    color: #444;
}

.rally-entry-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.rally-edit-icon, .rally-delete-icon {
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
}
.rally-edit-icon:hover, .rally-delete-icon:hover {
    opacity: 1;
}

li.rally-item-row {
    margin-bottom: 20px;

}
/* DONE STATE */
li.rally-item-row.is-done {
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.5s ease;
}

li.rally-item-row.is-done .rally-mark-done {
    opacity: 1; /* Keep the button visible so you can uncheck it */
    filter: grayscale(0%);
}

.rally-mark-done {
    cursor: pointer;
    margin-left: 5px;
    opacity: 0.5;
}
.rally-mark-done:hover {
    opacity: 1.0;
}

/* ----------------------------------------------------
   VISUAL INDICATORS
---------------------------------------------------- */

/* 1. Amber Warning Box for "Not Stated" text */
.rally-entry p:contains('Not Stated'),
.rally-entry-content strong:contains('Not Stated'),
.rally-entry-content p:contains('Not Stated') {
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ffeeba;
    font-weight: bold;
    display: inline-block;
    margin-right: 5px;
}

/* 2. Row Highlight for items flagged as missing data */
[data-status="not-stated"] {
    border-left: 4px solid #ffc107 !important; /* Amber border */
    background-color: #fffcf0 !important;      /* Light yellow background */
}

/* 3. Ensure the dashboard warnings don't break layout */
[data-status="not-stated"] .rally-entry-content {
    color: #555;
}

/* ----------------------------------------------------
   DARK MODE TOGGLE & STYLES
---------------------------------------------------- */

/* The Toggle Switch Container */
.rally-mode-switch-wrapper {
    margin-bottom: 20px;
    text-align: right; /* Put it in the top right usually */
}
.rally-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #444;
    padding: 5px 10px;
    background: #f0f0f1;
    border-radius: 20px;
}
.rally-dark-mode .rally-mode-switch {
    color: #e0e0e0;
    background: #333;
}

/* The Switch Box */
.rally-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    margin: 0;
}
.rally-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The Slider */
.rally-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.rally-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

/* Rounded Sliders */
.rally-slider.round {
    border-radius: 34px;
}
.rally-slider.round:before {
    border-radius: 50%;
}

/* Checked State */
input:checked + .rally-slider {
    background-color: #2271b1;
}
input:checked + .rally-slider:before {
    transform: translateX(22px);
}

/* Admin Note Box (Day Mode) */
.rally-admin-note {
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #2271b1;
    margin: 20px 0;
    color: #444; /* Ensure text is dark in day mode */
    border-radius: 0 4px 4px 0;
}

/* ----------------------------------------------------
   DARK MODE OVERRIDES
   Activates when body has class "rally-dark-mode"
---------------------------------------------------- */

body.rally-dark-mode {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* Dashboard Containers */
body.rally-dark-mode #rally-dashboard-v2,
body.rally-dark-mode .rally-accordion-group {
    background-color: #2d2d2d;
    border-color: #444;
}

/* Accordion Headers */
body.rally-dark-mode .rally-accordion-header {
    background-color: #383838;
    color: #f0f0f0;
    border-bottom: 1px solid #444;
}
body.rally-dark-mode .rally-accordion-header:hover {
    background-color: #444;
}

/* Accordion Content Area */
body.rally-dark-mode .rally-accordion-content {
    background-color: #2d2d2d;
    border-top-color: #444;
}

/* Segment Rows & Dividers */
body.rally-dark-mode .rally-segment-row {
    border-bottom-color: #444;
}

/* Inputs & Textareas */
body.rally-dark-mode .rally-quick-input {
    background-color: #333;
    color: #fff;
    border-color: #555;
}
body.rally-dark-mode .rally-quick-input:focus {
    border-color: #2271b1; /* Keep accent color */
    background-color: #404040;
}

/* Buttons */
body.rally-dark-mode .rally-add-btn {
    background-color: #444;
    border-color: #555;
    color: #fff;
}
body.rally-dark-mode .rally-add-btn:hover {
    background-color: #555;
}

/* Entries - Mine */
body.rally-dark-mode .rally-mine {
    background-color: #2c3e50; /* Darker blue bg */
    border-left-color: #2271b1;
    color: #e0e0e0;
}

/* Entries - Others */
body.rally-dark-mode .rally-others {
    background-color: #383838;
    border-left-color: #555;
    color: #aaa;
}

/* Text inside entries */
body.rally-dark-mode .rally-entry-content p {
    color: #ccc;
}

/* Cast Links Box */
body.rally-dark-mode .rally-cast-links {
    background-color: #223a48 !important; /* Dark blueish tint */
    border-color: #005b82 !important;
    color: #fff;
}

/* Warning Badges (Not Stated) - Adjusted for Dark Mode */
body.rally-dark-mode .rally-entry p:contains('Not Stated'),
body.rally-dark-mode .rally-entry-content strong:contains('Not Stated') {
    background: #5c4d00;
    color: #ffd700;
    border-color: #7a6600;
}

/* Row Highlights for Missing Data */
body.rally-dark-mode [data-status="not-stated"] {
    background-color: #3e3820 !important;
    border-left-color: #ffd700 !important;
}

/* Scrollbars (Optional nice touch for dark mode) */
body.rally-dark-mode ::-webkit-scrollbar {
    width: 10px;
}
body.rally-dark-mode ::-webkit-scrollbar-track {
    background: #2d2d2d;
}
body.rally-dark-mode ::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}
body.rally-dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Notes Body Override for Dark Mode */
body.rally-dark-mode .rally-notes-body {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
    color: #e0e0e0;
    box-shadow: none;
}

body.rally-dark-mode .rally-notes-body strong {
    color: #fff;
}

body.rally-dark-mode .rally-notes-body a {
    color: #4da6ff;
}

/* Admin Note Box (Dark Mode) */
body.rally-dark-mode .rally-admin-note {
    background: #383838;       /* Dark Grey background */
    border-left-color: #4da6ff; /* Lighter Blue accent */
    color: #e0e0e0;            /* Light Grey text */
}

/* Public Show Notes Container */
.rally-public-notes-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
}

.rally-public-show-block {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 2px solid #eee;
}

.rally-public-show-title {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
    border-left: 5px solid #2271b1;
    padding-left: 15px;
}

/* Segment Headers */
.rally-public-segment {
    margin-bottom: 30px;
}

.rally-public-segment-title {
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* List Items */
.rally-public-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rally-public-item {
    margin-bottom: 15px;
    padding-left: 0;
}

.rally-public-link {
    font-weight: bold;
    font-size: 1.1em;
    text-decoration: none;
    color: #2271b1;
}
.rally-public-link:hover {
    text-decoration: underline;
}

.rally-public-text-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

.rally-public-desc {
    margin: 5px 0 0 0;
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
}

/* Dark Mode Support (Automatic if your site uses the class on body) */
body.rally-dark-mode .rally-public-show-title { color: #fff; }
body.rally-public-segment-title { color: #aaa; border-color: #444; }
body.rally-public-link { color: #4da6ff; }
body.rally-public-text-title { color: #e0e0e0; }
body.rally-public-desc { color: #ccc; }