/**
 * Collabs - Custom CSS
 * Version: 1.0.0
 */

/* ====================================
   RESET & BASE STYLES
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ====================================
   CARD STYLES
   ==================================== */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
}

.card-header:first-child {
    border-radius: 12px 12px 0 0;
}

.card-body {
    padding: 1.25rem;
}

/* ====================================
   BUTTON STYLES
   ==================================== */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-sm {
    border-radius: 4px;
    font-size: 0.875rem;
}

.btn-dark {
    background-color: #343a40;
    border-color: #343a40;
}

.btn-dark:hover {
    background-color: #23272b;
    border-color: #1d2124;
}

.btn-outline-dark {
    color: #343a40;
    border-color: #343a40;
}

.btn-outline-dark:hover {
    background-color: #343a40;
    color: white;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(13,110,253,0.3);
}

.btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220,53,69,0.3);
}

/* ====================================
   BADGE STYLES
   ==================================== */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 4px;
}

/* ====================================
   STATUS COLORS
   ==================================== */
.status-proses {
    color: #ffc107;
    font-weight: 600;
    background-color: rgba(255,193,7,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.status-selesai {
    color: #198754;
    font-weight: 600;
    background-color: rgba(25,135,84,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.status-evaluasi {
    color: #dc3545;
    font-weight: 600;
    background-color: rgba(220,53,69,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* ====================================
   PRIORITY COLORS
   ==================================== */
.priority-high {
    color: #dc3545;
    font-weight: 600;
    background-color: rgba(220,53,69,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.priority-medium {
    color: #ffc107;
    font-weight: 600;
    background-color: rgba(255,193,7,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.priority-low {
    color: #198754;
    font-weight: 600;
    background-color: rgba(25,135,84,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* ====================================
   DEADLINE WARNING
   ==================================== */
.deadline-danger {
    color: #dc3545;
    font-weight: 600;
    background-color: rgba(220,53,69,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.85rem;
}

.deadline-warning {
    color: #ffc107;
    font-weight: 600;
    background-color: rgba(255,193,7,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.85rem;
}

.deadline-normal {
    color: #198754;
    background-color: rgba(25,135,84,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.85rem;
}

/* ====================================
   SUBTASK ITEMS (DRAG & DROP)
   ==================================== */
.subtask-item {
    cursor: grab;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin-bottom: 8px;
    border-radius: 6px;
}

.subtask-item:hover {
    background-color: #f8f9fa;
    border-left-color: #0d6efd;
    transform: translateX(2px);
}

.subtask-item:active {
    cursor: grabbing;
    opacity: 0.8;
}

.subtask-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background-color: #e9ecef;
    border-left-color: #0d6efd;
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    color: #6c757d;
    transition: color 0.2s;
    font-size: 1.2rem;
    user-select: none;
}

.drag-handle:hover {
    color: #0d6efd;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Placeholder saat drag */
.sortable-placeholder {
    background-color: #e9ecef;
    border: 2px dashed #0d6efd;
    min-height: 60px;
    border-radius: 8px;
    margin-bottom: 8px;
    opacity: 0.7;
}

/* ====================================
   COMMENTS STYLES
   ==================================== */
.comment-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.comments-container {
    font-size: 0.9rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.comments-container::-webkit-scrollbar {
    width: 4px;
}

.comments-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.comments-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.comments-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Avatar circle */
.rounded-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-transform: uppercase;
}

/* Reply item */
.reply-item {
    margin-left: 16px;
    border-left: 2px solid #dee2e6;
    padding-left: 12px;
}

/* Border start untuk komentar */
.border-start {
    border-left: 2px solid #dee2e6 !important;
}

/* Form komentar */
.add-comment-form,
.reply-form {
    margin-top: 8px;
}

.add-comment-form .input-group,
.reply-form .input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* ====================================
   NOTIFICATION STYLES
   ==================================== */
.notif-item {
    transition: background-color 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.notif-item:hover {
    background-color: #f8f9fa;
}

.notif-item.unread {
    background-color: #f0f7ff;
    border-left: 3px solid #0d6efd;
}

.notif-time {
    font-size: 0.7rem;
    color: #6c757d;
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notif-icon.info {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.notif-icon.success {
    background-color: #d1e7dd;
    color: #198754;
}

.notif-icon.warning {
    background-color: #fff3cd;
    color: #ffc107;
}

.notif-icon.danger {
    background-color: #f8d7da;
    color: #dc3545;
}

/* ====================================
   FILTER & SEARCH STYLES
   ==================================== */
.filter-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.task-card {
    transition: all 0.3s ease;
}

.task-card.filtered {
    animation: highlight 1s ease;
}

@keyframes highlight {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

/* Filter section */
.card.shadow-sm .form-select,
.card.shadow-sm .form-control {
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.card.shadow-sm .form-select:focus,
.card.shadow-sm .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.1);
}

/* ====================================
   MODAL STYLES
   ==================================== */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.25rem 1.5rem;
}

/* ====================================
   ALERTS & NOTIFICATIONS
   ==================================== */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.alert-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* ====================================
   FOOTER STYLES
   ==================================== */
.footer {
    margin-top: auto;
    background-color: white;
    border-top: 1px solid #e9ecef;
}

.footer .text-muted {
    font-size: 0.9rem;
}

/* ====================================
   RESPONSIVE STYLES
   ==================================== */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }
    
    .card-header > div {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    
    .subtask-item .d-flex {
        flex-wrap: wrap;
    }
    
    .notif-menu {
        width: 300px !important;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 6px !important;
        margin-bottom: 5px;
    }
}

/* ====================================
   UTILITY CLASSES
   ==================================== */
.cursor-pointer {
    cursor: pointer;
}

.cursor-default {
    cursor: default;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

.shadow-hover:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.transition-all {
    transition: all 0.3s ease;
}