.scheduler-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color, #333);
    padding-bottom: 10px;
}

[data-theme="light"] .scheduler-header-wrapper {
    background: var(--header-bg);
    border-bottom-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.scheduler-controls-header {
    margin-top: -15px;
}

.scheduler-container {
    max-width: 1800px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
}

.deck-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.deck-navigation h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-style: italic;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.reset-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: rgba(255, 107, 107, 0.4);
    color: white;
}

.schedule-btn {
    background: rgba(162, 155, 254, 0.2);
    border: 1px solid #a29bfe;
    color: #a29bfe;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.schedule-btn:hover {
    background: rgba(162, 155, 254, 0.4);
    color: white;
}

.scheduler-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Default 1 column (Mobile) */
    gap: 20px;
    width: 100%;
}

@media (min-width: 600px) {
    .scheduler-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .scheduler-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .scheduler-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1500px) {
    .scheduler-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.scheduler-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;

    /* 
    Card Sizing vs "Huge Box":
    - width: 100% of the grid cell. 
      (In 5-col mode, this is ~1/5th. In 1-col mode, this is full width).
    - max-width: 350px. 
      (IF we are in 1-col mode, stop expanding at 350px so it's not huge).
    - margin: 0 auto. 
      (Center the card if the cell is wider than 350px).
    */
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    box-sizing: border-box;
}

.scheduler-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.scheduler-card img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--border-color, #444);
}

.scheduler-card-info {
    flex: 1;
}

.scheduler-card-name {
    font-weight: bold;
    color: var(--primary-color, #a29bfe);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.scheduler-card-type {
    font-size: 0.8rem;
    color: #aaa;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.event-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Custom Checkbox */
/* Custom Checkbox (Turn Button Style) */
.event-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #666;
    border-radius: 50%;
    /* Circular */
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: bold;
    color: #888;
}

.event-item.checked .event-checkbox {
    background: var(--primary-color, #a29bfe);
    border-color: var(--primary-color, #a29bfe);
    box-shadow: 0 0 8px rgba(162, 155, 254, 0.4);
}

.event-checkbox::after {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    display: none;
}

.event-item.checked .event-checkbox::after {
    display: block;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.event-stage {
    font-size: 0.75rem;
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 2px;
}

.event-choices {
    margin-top: 5px;
    font-size: 0.75rem;
    color: #888;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.choice-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
}

.choice-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.choice-name {
    color: #a29bfe;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 2px;
    line-height: 1.3;
}

.choice-rewards {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.5;
    padding-left: 4px;
    /* Slight indent for hierarchy */
}

/* Ensure badges don't break weirdly */
.reward-line {
    display: block;
    margin-bottom: 2px;
}

.reward-tag {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-right: 4px;
    color: #fff;
}

.cond-fix {
    background-color: #6c5ce7;
    /* Purple for Fixed */
}

.cond-suc {
    background-color: #00b894;
    /* Green for Success */
}

.cond-fail {
    background-color: #d63031;
    /* Red for Fail */
}

.event-name {
    font-size: 0.95rem;
    color: #ddd;
}

.event-item.checked .event-name {
    color: #555;
    text-decoration: line-through;
}

.event-item.checked .choice-name {
    color: #666;
    text-decoration: line-through;
}

.event-item.checked .choice-rewards {
    color: #555;
}

.event-item.checked .event-stage {
    color: #444;
}

.event-item.checked .reward-tag {
    background-color: #555 !important;
    color: #aaa;
    box-shadow: none;
}

.empty-deck-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #888;

    font-size: 1.2rem;
}

/* Light Mode Overrides */
[data-theme="light"] .deck-navigation h2 {
    color: #333;
}

[data-theme="light"] .nav-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

[data-theme="light"] .nav-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: #333;
}

[data-theme="light"] .scheduler-card {
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .scheduler-card-header {
    border-bottom-color: #eee;
}

[data-theme="light"] .scheduler-card-name {
    color: #333;
}

[data-theme="light"] .scheduler-card-type {
    color: #666;
}

[data-theme="light"] .event-item {
    background: #f8f9fa;
    border: 1px solid #eee;
}

[data-theme="light"] .event-item:hover {
    background: #f0f0f0;
}

[data-theme="light"] .event-name {
    color: #333;
}

[data-theme="light"] .event-stage {
    color: #666;
}

[data-theme="light"] .choice-container {
    background: #fff;
    border: 1px solid #eee;
}

[data-theme="light"] .choice-name {
    color: #2c3e50;
}

[data-theme="light"] .choice-rewards {
    color: #555;
}

[data-theme="light"] .empty-deck-message {
    color: #666;
}

[data-theme="light"] .event-checkbox {
    border-color: #aaa;
    color: #888;
}

[data-theme="light"] .event-item.checked .event-checkbox {
    background: #54a0ff;
    /* Blue for consistent light mode theme */
    border-color: #54a0ff;
    color: white;
    box-shadow: 0 0 8px rgba(84, 160, 255, 0.4);
}

/* Checked state for light mode - keep it "dead" */
[data-theme="light"] .event-item.checked .event-name,
[data-theme="light"] .event-item.checked .choice-name {
    color: #aaa;
}

/* Light Mode Button Overrides */
/* Light Mode Button Overrides with Increased Specificity */
html[data-theme="light"] .reset-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
}

html[data-theme="light"] .reset-btn:hover {
    background: #ff6b6b;
    color: white;
}

html[data-theme="light"] .schedule-btn {
    background: rgba(162, 155, 254, 0.1);
    border: 1px solid #6c5ce7;
    color: #6c5ce7;
}

html[data-theme="light"] .schedule-btn:hover {
    background: #6c5ce7 !important;
    color: white !important;
}

/* Search Integration Styles */
.scheduler-counters {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-container-mockup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mockup-search-input {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #444;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    width: 200px;
}

[data-theme="light"] .mockup-search-input {
    background: white;
    border-color: #ccc;
    color: #333;
}

/* Search Results Overlay */
#scheduler-search-results {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px;
}

.search-active .scheduler-grid,
.search-active #schedule-view-container {
    display: none !important;
}

.search-active #scheduler-search-results {
    display: grid;
}

/* Modal Overlay Styles (replicated if missing) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}