/* css/vertical-stream.css */
/* Hybrid Vertical Contextual Navigation Styles */

.vertical-stream-layout {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: #0d0f1a; /* Dark theme background aligning with the provided design */
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
}

/* Left Column: Date Scroller */
.date-scroller-container {
    width: 80px; /* Slim vertical bar */
    flex-shrink: 0;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #121420; /* Slightly lighter than main bg */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    overflow-y: auto;
    /* Smooth scroll configuration */
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for cleaner look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.date-scroller-container::-webkit-scrollbar {
    display: none;
}

.date-scroller-month-header {
    font-size: 10px;
    font-weight: 800;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 10px 0 8px 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    background: rgba(99,102,241,0.1);
    padding: 6px 4px;
    border-radius: 6px;
    width: fit-content;
    align-self: center;
}

.date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 74px;
    margin-bottom: 6px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    user-select: none;
    padding-bottom: 4px;
}

.date-cell:active {
    transform: scale(0.95);
}

/* TODAY: ring + indigo background pulse instead of just a tiny dot */
.date-cell.is-today {
    background: rgba(99, 102, 241, 0.15);
    border: 2px solid rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 0 rgba(99,102,241,0.4);
    animation: todayPulse 2.5s ease-in-out infinite;
}

@keyframes todayPulse {
    0%   { box-shadow: 0 0 0 0px rgba(99,102,241,0.35); }
    50%  { box-shadow: 0 0 0 5px rgba(99,102,241,0.0); }
    100% { box-shadow: 0 0 0 0px rgba(99,102,241,0.35); }
}

.date-cell.is-today .day-name {
    color: #818cf8;
}

.date-cell.is-today .day-number {
    color: #c7d2fe;
    font-weight: 800;
}

/* Remove old ::after dot for today since we now use ring + dots below */
.date-cell.is-today::after {
    display: none;
}

.date-cell .day-name {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 1px;
    letter-spacing: 0.5px;
}

.date-cell .day-number {
    font-size: 17px;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1;
}

/* Task dot row — sits below the day number */
.task-dot-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 8px;
    margin-top: 3px;
}

/* Individual task indicator dot */
.t-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #6366f1;
    transition: transform 0.15s;
}

/* Scale & color dot by count context */
.date-cell.has-many-tasks .t-dot {
    background-color: #8b5cf6;
}

.date-cell.has-tasks:hover .t-dot {
    transform: scale(1.3);
}

/* Today with tasks: white dots */
.date-cell.is-today .t-dot {
    background-color: #c7d2fe;
}

/* Selected cell: white dots */
.date-cell.selected .t-dot {
    background-color: rgba(255,255,255,0.9);
}

/* Sentinel divs for infinite scroll — invisible placeholders */
.date-scroller-sentinel {
    width: 100%;
    height: 4px;
    flex-shrink: 0;
}

/* Selected State */
.date-cell.selected {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.date-cell.selected .day-name,
.date-cell.selected .day-number,
.date-cell.selected.is-today::after {
    color: #ffffff;
    background-color: transparent;
}

/* Drop Zone Feedback during Drag */
.date-cell.drop-zone-active {
    background-color: rgba(99, 102, 241, 0.2);
    border: 2px dashed #6366f1;
    transform: scale(1.05);
}

/* Right Column: Task Stream */
.task-stream-container {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    padding: 20px 15px 80px 15px; /* Extra bottom padding for scroll space */
    position: relative;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* Task Stream Header / Status Indicator */
.stream-header-info {
    margin-bottom: 24px;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.stream-title {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.stream-subtitle {
    font-size: 13px;
    color: #6366f1;
    margin-top: 4px;
    font-weight: 500;
}

.stream-header-actions {
    display: flex;
    gap: 12px;
}

.stream-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background-color: #1e2136;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.stream-icon-btn:hover {
    background-color: #272a44;
    color: #fff;
}

/* Accordion Groups */
.task-stream-group {
    margin-bottom: 24px;
    background-color: #161827;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.task-stream-group-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    position: sticky;
    top: 0;
    background-color: rgba(22, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
    user-select: none;
}

.group-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 12px;
}

.group-status-dot.todo { background-color: #eab308; }
.group-status-dot.doing { background-color: #6366f1; }
.group-status-dot.done { background-color: #10b981; }

.group-title {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    flex-grow: 1;
}

.group-count {
    background-color: #272a44;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 12px;
}

.group-toggle-icon {
    font-size: 14px;
    color: #64748b;
    transition: transform 0.3s ease;
}

.task-stream-group.collapsed .group-toggle-icon {
    transform: rotate(-180deg);
}

.task-stream-group-content {
    padding: 0 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 5000px; /* Arbitrary large value for transition */
    opacity: 1;
}

.task-stream-group.collapsed .task-stream-group-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* The Stream Card */
.stream-card {
    background-color: #1e2136;
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 3px solid transparent;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none; /* Crucial for long press */
    touch-action: pan-y; /* Crucial for scrolling vs dragging */
    /* iOS uzun basış "indir/paylaş" popup'ını CSS seviyesinde engelle */
    -webkit-touch-callout: none;
}

.stream-card.todo-card { border-left-color: #eab308; }
.stream-card.doing-card { border-left-color: #6366f1; }
.stream-card.done-card { border-left-color: #10b981; }

/* Subtask cards in stream — indented + slightly smaller */
.stream-card.stream-subtask-card {
    font-size: 0.93em;
    opacity: 0.9;
}
.stream-card.stream-subtask-card .stream-card-title {
    font-size: 12.5px;
}
.stream-subtask-indicator {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.45;
}

@media (max-width: 767px) {
    /* On mobile keep indent but limit to 12px per level so cards don't get too narrow */
    .stream-card[data-level="1"] { margin-left: 12px !important; }
    .stream-card[data-level="2"] { margin-left: 24px !important; }
    .stream-card[data-level="3"] { margin-left: 32px !important; }
}

.stream-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 4px 12px;
}

.stream-card-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #334155;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.stream-card.done-card .stream-card-checkbox {
    background-color: #6366f1;
    border-color: #6366f1;
}

.stream-card.done-card .stream-card-checkbox i {
    color: white;
    font-size: 10px;
}

.stream-card-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.stream-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 6px;
    line-height: 1.4;
}

.stream-card.done-card .stream-card-title {
    color: #94a3b8;
    text-decoration: line-through;
}

.stream-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.stream-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Progress Bar for Doing */
.stream-card-progress {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-track {
    flex-grow: 1;
    height: 6px;
    background-color: #272a44;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #6366f1;
    border-radius: 3px;
}

.progress-text {
    font-size: 11px;
    font-weight: 600;
    color: #818cf8;
}

/* Assignees area */
.stream-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    gap: 6px;
}

.stream-card-footer-left {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.stream-card-footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    justify-content: flex-end;
    flex: 1;
}

.stream-assignees {
    display: flex;
    align-items: center;
}

.stream-assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #1e2136;
    background-color: #4f46e5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    margin-left: -8px;
}

.stream-assignee-avatar:first-child {
    margin-left: 0;
}

.stream-card-deadline {
    font-size: 11px;
    color: #64748b;
}
.stream-pomo-mini {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

/* Date-shift button (calendar icon next to deadline) */
.stream-card-dateshift-btn {
    background: none;
    border: none;
    color: #64748b;
    padding: 2px 5px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 12px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.stream-card-dateshift-btn:hover {
    color: #a5b4fc;
    background: rgba(99,102,241,0.15);
}

.stream-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Floating State for Drag and Drop */
.stream-card.is-floating {
    position: fixed;
    z-index: 9999;
    width: calc(100% - 110px); /* Approximate width based on layout */
    max-width: 400px;
    opacity: 0.6;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 2px #6366f1;
    transform: scale(1.02) rotate(2deg);
    cursor: grabbing;
    pointer-events: none; /* Ensure events pass through to drop zone beneath */
}

/* Skeleton Placeholder */
.stream-card-skeleton {
    height: 100px;
    border-radius: 12px;
    background-color: rgba(30, 33, 54, 0.5);
    border: 2px dashed #475569;
}

/* Add New Task Inline Button */
.add-task-inline-btn {
    width: 100%;
    padding: 14px;
    background-color: transparent;
    border: 1px dashed #334155;
    border-radius: 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.add-task-inline-btn:hover {
    border-color: #475569;
    color: #94a3b8;
    background-color: rgba(255,255,255,0.02);
}

/* Overdue specific styling */
.task-stream-group.overdue-group {
    border-color: rgba(239, 68, 68, 0.3);
}

.task-stream-group.overdue-group .task-stream-group-header {
    background-color: rgba(127, 29, 29, 0.1);
}

.task-stream-group.overdue-group .group-status-dot {
    background-color: #ef4444;
}

.task-stream-group.overdue-group .group-title {
    color: #fca5a5;
}

/* Responsive adjustments */

/* Stream card: header (top row) and footer (bottom row) */
.stream-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 6px 12px;
}

.stream-card-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

/* Play/Pomodoro button on stream card (bottom footer) */
.stream-card-play-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.stream-card-play-btn:active {
    background-color: rgba(99, 102, 241, 0.35);
    transform: scale(0.9);
}

.stream-card-play-btn i {
    font-size: 11px;
    margin-left: 2px;
}

/* Reorder drop indicator */
.stream-card.reorder-drop-active {
    box-shadow: 0 -3px 0 0 #818cf8;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .date-scroller-container {
        width: 72px;
    }
    
    .date-cell {
        width: 56px;
        height: 68px;
    }
    
    .date-cell .day-number {
        font-size: 15px;
    }
    
    .task-stream-container {
        padding: 12px 10px 80px 10px;
    }
}
