/* CSS Variables for consistent theming */
:root{
    --brand-primary: #0d6efd; /* bootstrap primary */
    --muted: #6c757d;
    --bg-soft: #fbfbfc;
    --surface: #ffffff;
    --radius-sm: 6px;
    --radius-md: 10px;
    --gap-xs: 8px;
    --gap-sm: 12px;
    --gap-md: 20px;
}

/* Base typography and layout */
body{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    color: #212529;
    background: #fff;
}

main.container{ max-width: 1100px;  }

/* Unified card surface styles */
.card, .feature-card, .home-highlight, .rule-item {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

/* Buttons: ensure all CTAs feel consistent even when bootstrap variant used */
.btn {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
}

/* Forms & inputs */
input[type="text"], input[type="password"], textarea, select {
    border-radius: var(--radius-sm);
    border: 1px solid #e7e7e9;
    padding: 0.5rem 0.6rem;
}

/* Calendar / day cells - consistent sizing and spacing */
.col-day{
    padding: 6px;
    position: relative;
    border: 1px solid #f1f1f1;
    min-height: 84px;
    display:flex;
    align-items:flex-start;
    justify-content:flex-start;
    flex-direction:column;
    gap: var(--gap-xs);
    background: transparent;
    border-radius: var(--radius-sm);
}

#calendar-grid .day-cell{
    width:100%;
    height:100%;
    cursor:pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    padding: 8px;
    box-sizing: border-box;
}

#calendar-grid .day-cell:hover{
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    z-index:10;
}

#calendar-grid .day-number{
    font-size: 1rem;
    font-weight:600;
    color: var(--muted);
}

#calendar-grid .bg-light .day-number{ color: #333; }
#calendar-grid .bg-success .day-number,
#calendar-grid .bg-warning .day-number,
#calendar-grid .bg-danger .day-number{
    color: #fff;
}

/* Today's highlight - single place to control appearance */
#calendar-grid .day-cell.today{
    border: 2px solid var(--brand-primary);
    box-shadow: 0 0 0 6px rgba(13,110,253,0.06);
    border-radius: calc(var(--radius-sm) + 2px);
}

/* Weekly/Daily Detail View */
#weeks-accordion .accordion-button,
#current-week-view .accordion-button{
    font-size: 1.05rem;
    font-weight: 600;
}

#weeks-accordion .day-tasks h5,
#current-week-view .day-tasks h5{
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

/* Task rows */
.task{
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background-color .14s ease, transform .08s ease;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.task:hover{ background-color: #f8f9fa; transform: translateY(-1px); }
.task.saving{ opacity:0.6; pointer-events:none; }
.task-status{ font-size:1.4rem; }
.status-icon{ display:none; }

/* Homepage hero */
.hero{
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 40px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}
.hero h2{ font-size: 1.9rem; margin-bottom:8px; line-height:1.12; }
.hero .lead{ font-size:1.05rem; color:var(--muted); }

.intro-container{ margin: 28px auto; padding: 0 16px; }

.feature-card{ transition: transform .12s ease, box-shadow .12s ease; }
.feature-card:hover{ transform: translateY(-6px); box-shadow: 0 14px 34px rgba(0,0,0,0.07); }
.feature-icon{ font-size:1.6rem; color:#fff; width:52px; height:52px; display:flex; align-items:center; justify-content:center; border-radius:12px; }

.illustration{ display:flex; align-items:center; justify-content:center; height:200px; background: linear-gradient(135deg,#eef7ff,#ffffff); border-radius:var(--radius-md); }

/* Small screens adjustments */
@media (max-width:576px){
    .hero{ padding:18px 12px; }
    .hero h2{ font-size:1.4rem; }
    main.container{ padding:0 8px; }
}

/* Minor spacing cleanup for consistent card bodies */
.feature-card .card-body, .card .card-body, .home-highlight{ padding:16px; }

/* Make lists and rules consistent */
.home-rules{ margin-bottom:16px; padding-left:18px; }

/* Utility */
.text-muted { color: var(--muted) !important; }


#calendar-grid .day-cell {
    cursor: pointer;
    transition: transform .2s;
}

#calendar-grid .day-cell:hover {
    transform: scale(1.05);
    z-index: 10;
}

#calendar-grid .day-number {
    position: static;
    font-size: 1.2rem;
    font-weight: 500;
}

#calendar-grid .bg-light .day-number { color: #333; }
#calendar-grid .bg-success .day-number,
#calendar-grid .bg-warning .day-number,
#calendar-grid .bg-danger .day-number {
    color: #fff;
    font-weight: bold;
}

/* Highlight for today's date in the monthly calendar */
#calendar-grid .day-cell.today {
    box-shadow: 0 0 0 2px rgba(13,110,253,0.18);
    border-radius: 6px;
    position: relative;
    z-index: 12;
}

#calendar-grid .day-cell.today .day-number { font-weight: 700; }

/* Highlight today's date in the monthly calendar */
#calendar-grid .day-cell.today {
    border: 2px solid #0d6efd; /* Bootstrap primary */
    box-shadow: 0 0 0 4px rgba(13,110,253,0.08);
    border-radius: 8px;
}

/* Weekly/Daily Detail View */
#weeks-accordion .accordion-button,
#current-week-view .accordion-button {
    font-size: 1.1rem;
    font-weight: 500;
}

#weeks-accordion .day-tasks h5,
#current-week-view .day-tasks h5 {
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

/* Make the entire task row interactive */
.task {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease-in-out;
}

.task:hover {
    background-color: #f8f9fa; /* Light gray on hover */
}

/* Style for when a task is being saved */
.task.saving {
    opacity: 0.6;
    pointer-events: none; /* Prevent clicking while saving */
}

.task-status {
    font-size: 1.5rem;
}

.status-icon {
    display: none; /* Hide all by default */
    transition: opacity 0.2s ease-in-out;
}

/* Homepage hero and intro styles */
.hero {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 48px 24px;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.07);
}


.hero h2 {
    font-size: 2.1rem;
    margin-bottom: 12px;
    color: #212529;
    line-height: 1.15;
}

.hero .lead {
    font-size: 1.08rem;
    color: #495057;
    margin-bottom: 18px;
    line-height: 1.6;
}

.cta-buttons a { margin: 6px 6px; }

.intro-container { margin: 30px auto; padding: 0 20px; }

.home-highlight {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    padding: 18px;
    margin-bottom: 18px;
}

.home-rules { margin-bottom: 22px; padding-left: 18px; }

@media (max-width: 576px) {
    .hero h2 { font-size: 1.5rem; }
    .hero { padding: 20px 12px; }
    .intro-container { padding: 0 12px; }
}

/* Redesigned homepage sections */
.features { margin-top: 28px; }
.feature-card { transition: transform .15s ease, box-shadow .15s ease; }
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 12px 34px rgba(0,0,0,0.09); }
.feature-icon { font-size: 2rem; color: #fff; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.rules-grid { margin-top: 26px; }
.rule-item { padding: 16px; border-radius: 8px; background: #fbfbfc; box-shadow: 0 4px 14px rgba(0,0,0,0.04); margin-bottom: 16px; }
.illustration { display:flex; align-items:center; justify-content:center; height:220px; background: linear-gradient(135deg,#eef7ff,#ffffff); border-radius:10px; }

/* Tighter content spacing for the main layout */
.hero, .intro-container, .features { margin-left: 0; margin-right: 0; }

/* Card and body spacing improvements */
.feature-card .card-body { padding: 18px; }
.card .card-body { padding: 16px; }
.home-highlight { padding: 24px; }
.home-rules { margin-bottom: 22px; padding-left: 20px; }

/* Increase global line-height slightly for readability */
body { line-height: 1.6; }
