/* Clean Tiles Design - Questions and Tasks */

/* Base tile container */
.clean-tile {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin-bottom: 0.25rem; /* Reduced from 0.375rem (6px to 4px) for tighter spacing */
    border-radius: 0.375rem 0 0 0.375rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 2.75rem; /* Further reduced to match slimmer content */
}

/* Question tile styling */
.clean-tile.question {
    background-color: rgba(29, 78, 216, 0.1);
    border-left: 3px solid rgba(59, 130, 246, 0.6);
}

.clean-tile.question:hover {
    background-color: rgba(29, 78, 216, 0.15);
    border-left-color: rgba(59, 130, 246, 0.8);
}

/* Task tile styling */
.clean-tile.task {
    background-color: rgba(107, 70, 193, 0.1); /* Very light purple (10% opacity) */
    border-left: 3px solid rgba(139, 92, 246, 0.6); /* Medium purple (60% opacity) */
}

.clean-tile.task:hover {
    background-color: rgba(107, 70, 193, 0.15); /* Slightly darker purple (15% opacity) */
    border-left-color: rgba(139, 92, 246, 0.8); /* Brighter purple on hover (80% opacity) */
}

/* Line 1: Header row */
.tile-header {
    display: flex;
    align-items: center;
    gap: 0.25rem; /* Reduced from 0.375rem (6px to 4px) */
    padding: 0.125rem 0.5rem; /* Reduced vertical padding from 0.25rem to 0.125rem (4px to 2px) */
    margin: 0;
}

/* Header background for questions */
.clean-tile.question .tile-header {
    background-color: rgba(29, 78, 216, 0.15);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

/* Header background for tasks */
.clean-tile.task .tile-header {
    background-color: rgba(107, 70, 193, 0.15); /* Subtle purple header (15% opacity) */
    border-bottom: 1px solid rgba(139, 92, 246, 0.2); /* Light purple border (20% opacity) */
}

/* Icon styling */
.tile-icon {
    width: 1rem; /* Reduced from 1.25rem (20px to 16px) */
    height: 1rem; /* Reduced from 1.25rem (20px to 16px) */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tile-icon i {
    font-size: 0.875rem; /* Reduced from 1rem (16px to 14px) */
}

.question .tile-icon i {
    color: #60a5fa;
}

.task .tile-icon i {
    color: #a78bfa; /* Medium bright purple - matches the color scale */
}

/* Type label */
.tile-type {
    font-size: 0.7rem; /* Reduced from 0.75rem for slimmer header */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    width: 65px;
    flex-shrink: 0;
    display: inline-block;
}

/* Override opacity for task type to ensure pure white */
.task .tile-type {
    opacity: 1;
}

.question .tile-type {
    color: #60a5fa;
}

.task .tile-type {
    color: #a78bfa; /* Purple text matching icon - same as questions use blue */
}

/* Header right section with fixed widths */
.tile-header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    min-width: 7rem; /* Fixed width for button space */
    justify-content: flex-end;
}

/* Status badge */
.tile-status {
    position: absolute;
    right: 0;
    padding: 0.125rem 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    border-radius: 0.25rem;
    border: 1px solid;
    min-width: 5rem;
    transition: opacity 0.15s ease;
    transition-delay: 0.05s; /* Delay reappearing until buttons fade */
}

/* Hide status on hover when buttons appear */
.clean-tile:hover .tile-status {
    opacity: 0;
    transition-delay: 0s; /* Fade out immediately on hover */
}

/* Status colors */
.tile-status.unasked {
    background-color: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.3);
}

.tile-status.asked {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.tile-status.answered {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

.tile-status.denied,
.tile-status.no-answer {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.tile-status.pending {
    background-color: rgba(251, 146, 60, 0.2);
    color: #fb923c;
    border-color: rgba(251, 146, 60, 0.3);
}

.tile-status.in-progress {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.tile-status.completed {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

/* Action buttons */
.tile-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
    transition-delay: 0.05s; /* Slight delay to prevent flicker */
    justify-content: flex-end;
    position: relative;
    z-index: 1; /* Ensure buttons appear above status */
}

/* Show actions on tile hover */
.clean-tile:hover .tile-actions {
    opacity: 1;
    transition-delay: 0.05s; /* Start appearing as status fades */
}

.tile-action-btn {
    padding: 0.25rem 0.375rem;
    background-color: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 0.25rem;
    color: #93bbfc;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    position: relative;
}

/* Tooltip wrapper for action buttons */
.tile-actions {
    position: relative;
}

/* Instant tooltip styling */
.tile-action-btn {
    position: relative;
}

.tile-action-btn::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    padding: 0.375rem 0.5rem;
    background-color: rgba(17, 24, 39, 0.95);
    color: #e5e7eb;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    border-radius: 0.25rem;
    border: 1px solid rgba(75, 85, 99, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.tile-action-btn:hover::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Tooltip arrow */
.tile-action-btn::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(17, 24, 39, 0.95);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.tile-action-btn:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.tile-action-btn:hover {
    background-color: rgba(59, 130, 246, 0.35);
    border-color: rgba(59, 130, 246, 0.6);
    color: #bbd2fc;
    transform: translateY(-1px);
}

.tile-action-btn i {
    font-size: 0.75rem;
}

/* Red X button styling for skip/cancel actions */
.tile-action-btn-danger {
    background-color: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.tile-action-btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
}

/* Line 2: Content row - Full width */
.tile-content {
    display: flex;
    align-items: flex-start;
    padding: 0.25rem 0.5rem; /* Reduced from 0.375rem (6px to 4px) vertical padding */
}

/* Main text - now takes full width */
.tile-text {
    flex: 1;
    font-size: 0.9375rem !important; /* Slightly reduced from 1rem (15px instead of 16px) */
    line-height: 1.4; /* Tighter line height from 1.5 */
    color: #d1d5db;
}

/* Line 3: Metadata row */
.tile-metadata {
    display: flex;
    align-items: center; /* Center items vertically */
    gap: 0.5rem; /* Reduced from 0.75rem (12px to 8px) */
    padding: 0.125rem 0.5rem 0.25rem 0.5rem; /* Reduced top/bottom padding */
    font-size: 0.7rem; /* Slightly smaller from 0.75rem */
    color: #9ca3af;
    flex-wrap: nowrap; /* Keep items on same line */
    position: relative;
}

/* Priority badge - now in metadata line */
.tile-metadata .tile-priority {
    flex: 0 0 auto;
    min-width: 26px; /* Slightly reduced from 28px */
    padding: 0.0625rem 0.25rem; /* Reduced padding */
    border-radius: 0.25rem;
    font-size: 0.65rem; /* Reduced from 0.7rem to match smaller metadata */
    font-weight: 600;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.tile-priority.high {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.tile-priority.medium {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.tile-priority.low {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Reason in metadata line */
.tile-metadata .tile-reason {
    flex: 1 1 auto; /* Take up available space */
    font-size: 0.7rem; /* Match metadata font size */
    color: #9ca3af;
    font-style: italic;
    line-height: 1.1rem; /* Tighter line height */
    opacity: 0.8; /* Show by default */
    max-width: calc(100% - 65px); /* Show by default with proper width */
    overflow: hidden;
    white-space: normal; /* Allow wrapping */
    text-overflow: ellipsis;
    transition: opacity 0.3s ease, max-width 0.3s ease;
    align-self: center; /* Center vertically */
    margin-right: 0.5rem; /* Space before timestamp */
}

/* Timestamp in metadata line - pushed to the right */
.tile-metadata .tile-timestamp {
    font-size: 0.7rem; /* Match metadata font size */
    color: #9ca3af;
    flex: 0 0 auto;
    white-space: nowrap;
    margin-left: auto; /* Push to the right */
    width: 1.75rem; /* Fixed width for HH:MM - half of previous 3.5rem */
    text-align: right;
}

/* Remove the hiding rules - reasons should always be visible */
/* Only enhance visibility on hover */
.clean-tile:hover .tile-metadata .tile-reason {
    opacity: 1; /* Full opacity on hover */
}

/* Removed visual indicator dot - no longer needed */

/* Pinned Notes Styling */
.clean-tile.note {
    background-color: rgba(217, 119, 6, 0.05); /* Toned down from 0.1 */
    border-left: 3px solid rgba(251, 191, 36, 0.4); /* Toned down from 0.6 */
    cursor: pointer;
}

.clean-tile.note:hover {
    background-color: rgba(217, 119, 6, 0.08); /* Toned down from 0.15 */
    border-left-color: rgba(251, 191, 36, 0.5); /* Toned down from 0.8 */
}

/* Note layout - simplified single column */
.note-layout {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
}

/* First line container */
.note-first-line {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

/* Pin icon wrapper - simple and clean */
.pin-wrapper {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Pin icon itself */
.pin-wrapper i {
    color: #fbbf24; /* Match the Pinned Notes header yellow */
    font-size: 0.875rem;
    line-height: 1;
}

/* Pinned text content */
.pinned-content {
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: #d1d5db;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* The quoted text portion */
.note-pinned-quote {
    flex: 1;
    min-width: 0;
}

/* Source info inline at end of quote */
.note-source-info {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    margin-left: 0.5rem !important;
    font-size: 0.75rem !important;
    color: #9ca3af !important;
    flex-shrink: 0;
}

.note-source-icon {
    font-size: 0.75rem; /* Smaller for inline display */
    opacity: 0.8;
    display: inline-block !important;
    line-height: 1;
}

.note-source-icon.transcript { color: #3b82f6; }
.note-source-icon.map { color: #ef4444; }
.note-source-icon.entities { color: #a855f7; }
.note-source-icon.chat { color: #10b981; }
.note-source-icon.files { color: #f59e0b; }

.note-timestamp {
    font-size: 0.7rem; /* Slightly larger for inline display */
    color: #9ca3af;
    display: inline-block !important;
    line-height: 1;
    white-space: nowrap;
}

/* Note content area */
.note-content-area {
    flex: 1;
    min-width: 0;
}

/* User's note - takes full width on second line */
.note-user-text {
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: #d1d5db;
    font-style: normal;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Floating delete button - only visible on hover */
.note-delete-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    display: none;
    padding: 0.25rem 0.375rem;
    background-color: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 0.25rem;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.clean-tile.note:hover .note-delete-btn {
    display: block;
}

.note-delete-btn:hover {
    background-color: rgba(220, 38, 38, 1);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}