/* ==========================================================================
   DramicBox - Admin Tasks & Staff Chat (WhatsApp / Slack Style) Stylesheet
   ========================================================================== */

/* --- Task Management System --- */
.task-badge-priority {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.task-badge-priority.urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.task-badge-priority.normal {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}
.task-badge-priority.low {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.task-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.task-status-chip.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.task-status-chip.in_progress {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.4);
}
.task-status-chip.submitted {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.4);
}
.task-status-chip.revision {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.4);
}
.task-status-chip.completed {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}
.task-status-chip.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.task-card-modern {
    background: rgba(15, 17, 26, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}
.task-card-modern:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.task-card-modern.priority-urgent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #ef4444, #f97316);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.task-series-info {
    display: flex;
    gap: 12px;
    align-items: center;
}
.task-series-poster {
    width: 44px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #1e1e2d;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.task-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    line-height: 1.3;
}
.task-sub-info {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-size: 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #e2e8f0;
}
.task-assignee-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.task-actions-row {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- WhatsApp-Style Staff Chat System --- */
.staff-chat-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.staff-chat-container {
    width: min(1100px, 95vw);
    height: min(780px, 90vh);
    background: #0d1117;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65);
}

/* Sidebar */
.staff-chat-sidebar {
    width: 320px;
    background: #11141f;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.staff-chat-sidebar-head {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.staff-chat-search-wrap {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.staff-chat-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 14px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
}
.staff-chat-search-input:focus {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
}

.staff-chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.staff-chat-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 10px 4px;
}

.staff-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: #cbd5e1;
}
.staff-chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}
.staff-chat-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(236, 72, 153, 0.15));
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
}

.staff-chat-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    position: relative;
}
.staff-chat-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    position: relative;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
}

.staff-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #11141f;
}

.staff-chat-item-info {
    flex: 1;
    min-width: 0;
}
.staff-chat-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.staff-chat-item-sub {
    font-size: 0.76rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
}

/* Chat Main View */
.staff-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #090c12;
    position: relative;
}

.staff-chat-main-header {
    padding: 16px 22px;
    background: rgba(17, 20, 31, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.staff-chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.staff-msg-bubble-wrap {
    display: flex;
    gap: 10px;
    max-width: 75%;
    animation: fadeInUp 0.15s ease-out;
}
.staff-msg-bubble-wrap.outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.staff-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
}

.staff-msg-bubble {
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    color: #e2e8f0;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}
.staff-msg-bubble-wrap.outgoing .staff-msg-bubble {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    color: #ffffff;
    border-color: rgba(167, 139, 250, 0.4);
    border-top-left-radius: 16px;
    border-top-right-radius: 4px;
}

.staff-msg-author {
    font-size: 0.75rem;
    font-weight: 800;
    color: #c4b5fd;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.staff-msg-role-tag {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.staff-msg-attachment-img {
    max-width: 280px;
    max-height: 200px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 6px;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.staff-msg-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 6px;
}
.staff-msg-attachment-file:hover {
    background: rgba(0, 0, 0, 0.4);
}

.staff-msg-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* Chat Input Bar */
.staff-chat-input-bar {
    padding: 14px 20px;
    background: #11141f;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 10px 16px;
    color: #fff;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s ease;
}
.staff-chat-input:focus {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
}

.staff-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}
.staff-chat-send-btn:hover {
    transform: scale(1.05);
}

.staff-chat-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.staff-chat-attach-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Floating Launcher Button */
.staff-chat-floating-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.staff-chat-floating-launcher:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.6);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .staff-chat-container {
        flex-direction: column;
        height: 96vh;
    }
    .staff-chat-sidebar {
        width: 100%;
        height: 200px;
    }
}
