/* === Base Styles === */
body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: #f8fafc;
    color: #334155;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    user-select: none;
}

/* === Animations === */
.fade-in-up { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; transform: translateY(20px); }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* Simple Fade In (for Accordion) */
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.modal-enter { animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes modalEnter { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

/* === Calendar Styles === */
.calendar-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; cursor: pointer; position: relative; font-weight: 600;
    transition: all 0.2s ease; color: #64748b;
}
.calendar-day:hover:not(.empty-day) { background-color: #e2e8f0; color: #1e293b; }
.calendar-day.has-event::after {
    content: ''; position: absolute; bottom: 15%; left: 50%; transform: translateX(-50%);
    width: 5px; height: 5px; border-radius: 50%; background-color: #ef4444;
}
.calendar-day.is-today { background-color: #fef08a; color: #854d0e; border: 2px solid #eab308; }
.calendar-day.is-selected { background-color: #4f46e5; color: white; box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.4); }

/* === QSC Styles === */
.qsc-checkbox { appearance: none; width: 1.25rem; height: 1.25rem; border: 2px solid #cbd5e1; border-radius: 0.375rem; cursor: pointer; transition: all 0.2s; position: relative; }
.qsc-checkbox:checked { background-color: #22c55e; border-color: #22c55e; }
.qsc-checkbox:checked::after { content: '✓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 0.875rem; font-weight: bold; }

/* === Utility === */
.text-pretty { text-wrap: pretty; }
.word-keep { display: inline-block; }

/* =========================================
   Task Manager Styles (Timeline)
   ========================================= */
.timeline-container {
    width: 100%; overflow-x: auto; background-color: #ffffff; border: 1px solid #e2e8f0;
    border-radius: 1rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); position: relative; padding-bottom: 8px;
}
.timeline-table { width: 100%; min-width: 1200px; border-collapse: separate; border-spacing: 0; }
.timeline-table th, .timeline-table td {
    border-bottom: 1px solid #f1f5f9; border-right: 1px solid #f1f5f9; padding: 0;
    height: 4rem; vertical-align: top; position: relative; box-sizing: border-box;
}
.timeline-table thead th {
    background-color: #f8fafc; color: #64748b; font-size: 0.75rem; font-weight: 700;
    text-align: center; vertical-align: middle; position: sticky; top: 0; z-index: 20;
    padding: 0.75rem 0; border-bottom: 2px solid #e2e8f0;
}
.timeline-table tbody th {
    background-color: #ffffff; color: #1e293b; font-size: 0.9rem; font-weight: 700;
    min-width: 160px; max-width: 160px; position: sticky; left: 0; z-index: 10;
    text-align: left; padding: 0 1rem; vertical-align: middle; border-right: 2px solid #e2e8f0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 4px 0 10px -5px rgba(0,0,0,0.05);
}
.task-bar {
    position: absolute; top: 6px; left: 1px; right: 1px; bottom: 6px; border-radius: 6px;
    padding: 0 0.5rem; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); overflow: hidden; white-space: nowrap; z-index: 5; transition: transform 0.1s; cursor: pointer;
}
.task-bar:hover { z-index: 30; transform: scaleY(1.1) scaleX(1.01); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* Task Colors */
.task-bar.pair-task, .pair-task { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.task-bar.briefing-task, .briefing-task { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.task-bar.money-task, .money-task { background: #fef9c3; color: #854d0e; border-left: 4px solid #eab308; }
.task-bar.free-task, .free-task { background: #f8fafc; color: #94a3b8; border: 1px dashed #cbd5e1; box-shadow: none; }
.task-bar.parking-task, .parking-task { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.task-bar.lock-task, .lock-task, .task-bar.toolbox-task, .toolbox-task, .task-bar.handoff-task, .handoff-task { background: #f3e8ff; color: #6b21a8; border-left: 4px solid #a855f7; }
.task-bar.alba-close-task, .alba-close-task { background: #ffe4e6; color: #be123c; border-left: 4px solid #f43f5e; }
.task-bar.staff-15min-task, .staff-15min-task, .task-bar.special-opening-task, .special-opening-task { background: #cffafe; color: #155e75; border-left: 4px solid #06b6d4; }
.task-bar.color-gray, .color-gray { background: #f1f5f9; color: #475569; border-left: 4px solid #94a3b8; }

/* =========================================
   NEW: Card-Style Edit UI
   ========================================= */
.staff-grid {
    display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
@media (min-width: 768px) { .staff-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .staff-grid { grid-template-columns: repeat(3, 1fr); } }

.staff-card {
    background: white; border: 1px solid #e2e8f0; border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); overflow: hidden;
    transition: all 0.2s ease; display: flex; flex-direction: column;
}
.staff-card:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); transform: translateY(-2px); border-color: #cbd5e1; }

.staff-card-header {
    background-color: #f8fafc; padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9;
    display: flex; justify-content: space-between; align-items: center;
}
.staff-name { font-weight: 800; color: #334155; font-size: 1rem; }
.staff-card-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; }

.task-edit-row {
    display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem;
    background: #ffffff; border: 1px dashed #cbd5e1; border-radius: 0.75rem;
    position: relative; transition: background 0.2s;
}
.task-edit-row:hover { background: #f8fafc; border-style: solid; border-color: #94a3b8; }

.time-group { display: flex; align-items: center; gap: 0.5rem; }
.time-btn {
    flex: 1; background: #f1f5f9; color: #475569; font-weight: 700; font-size: 0.85rem;
    padding: 0.4rem; border-radius: 0.5rem; text-align: center; cursor: pointer; transition: all 0.2s;
}
.time-btn:hover { background: #e2e8f0; color: #1e293b; }
.time-btn.empty { color: #94a3b8; background: #f8fafc; border: 1px dashed #cbd5e1; }

.task-select-btn {
    width: 100%; padding: 0.6rem 0.75rem; border-radius: 0.5rem; font-weight: 700; font-size: 0.9rem;
    text-align: left; display: flex; align-items: center; justify-content: space-between;
    transition: all 0.2s; background: #f1f5f9; color: #64748b; border: 1px solid transparent;
}
.task-select-btn:hover { filter: brightness(0.95); }
.task-select-btn.placeholder { background: white; border: 1px dashed #cbd5e1; color: #94a3b8; }

.remarks-input {
    width: 100%; font-size: 0.8rem; padding: 0.4rem 0.5rem; border: none; background: transparent;
    border-bottom: 1px solid #e2e8f0; color: #475569; transition: border 0.2s;
}
.remarks-input:focus { outline: none; border-bottom-color: #6366f1; background: #f8fafc; }

.task-delete-btn {
    position: absolute; top: -6px; right: -6px; width: 24px; height: 24px;
    background: white; border: 1px solid #ef4444; color: #ef4444; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0; transition: all 0.2s; z-index: 5;
}
.task-edit-row:hover .task-delete-btn { opacity: 1; transform: scale(1); }
@media (max-width: 768px) { .task-delete-btn { opacity: 1; top: 0; right: 0; } }

/* === Shared Modals === */
.modal-overlay, .select-modal-overlay {
    position: fixed; inset: 0; background-color: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem;
}
.modal-content, .select-modal-content {
    background: white; border-radius: 1rem; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%; max-width: 500px; overflow: hidden; animation: modalIn 0.2s ease-out forwards;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Select Modal Improvements */
.select-modal-body { max-height: 50vh; overflow-y: auto; }
.select-modal-option { padding: 0.75rem 1.25rem; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background 0.2s; font-size: 0.95rem; font-weight: 500; }
.select-modal-option:hover { background-color: #f8fafc; }
.select-modal-option.selected { background-color: #eff6ff; color: #2563eb; font-weight: 800; border-left: 4px solid #2563eb; padding-left: calc(1.25rem - 4px); }

.select-modal-footer {
    padding: 1rem; border-top: 1px solid #f1f5f9; background: #ffffff;
    display: flex; justify-content: flex-end; gap: 0.75rem;
}
.confirm-btn {
    background: #4f46e5; color: white; font-weight: 700; padding: 0.5rem 1.5rem;
    border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2); transition: all 0.2s;
}
.confirm-btn:hover { background: #4338ca; transform: translateY(-1px); }
.confirm-btn:disabled { background: #cbd5e1; cursor: not-allowed; box-shadow: none; transform: none; }

/* === Bulk Delete Menu === */
.delete-menu-grid {
    display: grid; gap: 1rem; padding: 1rem;
}
.delete-menu-section {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 1rem;
}
.delete-menu-title {
    font-size: 0.85rem; font-weight: 800; color: #64748b; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}
.delete-menu-buttons {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.btn-delete-task {
    background: #white; border: 1px solid #cbd5e1; color: #475569; font-weight: 700; font-size: 0.8rem;
    padding: 0.5rem; border-radius: 0.5rem; transition: all 0.2s;
}
.btn-delete-task:hover { background: #f1f5f9; color: #1e293b; }

.btn-delete-staff {
    background: #fff1f2; border: 1px solid #fecdd3; color: #e11d48; font-weight: 700; font-size: 0.8rem;
    padding: 0.5rem; border-radius: 0.5rem; transition: all 0.2s;
}
.btn-delete-staff:hover { background: #ffe4e6; }

.btn-reset-all {
    width: 100%; background: #ef4444; color: white; font-weight: 800; padding: 0.75rem;
    border-radius: 0.75rem; box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-reset-all:hover { background: #dc2626; transform: translateY(-1px); }

/* === Toast Notification (Pop-up) === */
.toast-notification {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px); /* Initially hidden above */
    background-color: #1e293b; /* Dark slate */
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast-notification::before {
    content: '✅';
    font-size: 1.1rem;
}

/* === Operations Input Modal Styles === */
.op-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.op-input-group label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
}
.op-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-weight: 700;
    color: #334155;
    text-align: center;
}
.op-input:focus {
    outline: none;
    border-color: #6366f1;
    background-color: #f8fafc;
}
