/* assets/css/style.css */
/* Modern Chat Application Styles */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --secondary: #8B5CF6;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --dark: #1E293B;
    --dark-2: #334155;
    --dark-3: #475569;
    --light: #F1F5F9;
    --light-2: #E2E8F0;
    --white: #FFFFFF;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* Layout */
.chat-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.sidebar-header h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
}

.user-info .avatar {
    border: 2px solid var(--white);
}

/* Search */
.search-box {
    padding: 15px;
    border-bottom: 1px solid var(--light-2);
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-2);
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Chat Tabs */
/* Chat Filter Dropdown */
.chat-filter {
    padding: 15px;
    padding-bottom: 0;
}

.chat-type-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-2);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    background-color: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    
    /* Remove default dropdown styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475569' d='M1.41 0L6 4.58L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.chat-type-select:hover {
    border-color: var(--primary);
}

.chat-type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Chat List */
.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--light-2);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-item:hover {
    background: var(--light);
}

.chat-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
    border-left: 3px solid var(--primary);
}

.chat-item-avatar {
    position: relative;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid var(--white);
}

.status-indicator.online { background: var(--success); }
.status-indicator.away { background: var(--warning); }
.status-indicator.busy { background: var(--danger); }
.status-indicator.offline { background: var(--dark-3); }

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
}

.chat-time {
    font-size: 12px;
    color: var(--dark-3);
}

.chat-preview {
    font-size: 13px;
    color: var(--dark-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.chat-header {
    padding: 20px 25px;
    background: var(--white);
    border-bottom: 1px solid var(--light-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header-details h3 {
    font-size: 18px;
    margin-bottom: 3px;
}

.chat-header-details p {
    font-size: 13px;
    color: var(--dark-3);
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: var(--light-2);
}

/* Messages Area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--light-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.message-content {
    max-width: 60%;
}

.message.sent .message-content {
    align-items: flex-end;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.message-sender {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.message-time {
    font-size: 11px;
    color: var(--dark-3);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.received .message-bubble {
    background: var(--light);
    color: var(--dark);
    border-bottom-left-radius: 4px;
}

.message.sent .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message-status {
    font-size: 11px;
    color: var(--dark-3);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message.sent .message-status {
    justify-content: flex-end;
}

/* Message Input */
.message-input-area {
    padding: 20px 25px;
    background: var(--white);
    border-top: 1px solid var(--light-2);
}

.message-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.message-input-container {
    flex: 1;
    background: var(--light);
    border-radius: 25px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
}

.send-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-2);
    border-radius: 8px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* User List Items (with checkboxes) */
.user-item-checkbox {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--light-2);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-item-checkbox:hover {
    background: var(--light);
    border-color: var(--primary);
}

.user-item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.user-item-checkbox .user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-item-checkbox .user-email {
    font-size: 12px;
    color: var(--dark-3);
}

.user-item-checkbox .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
}


/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--dark-3);
    text-align: center;
    padding: 40px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state-subtext {
    font-size: 14px;
    color: var(--dark-3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--light-2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-3);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -320px;
        height: 100%;
        z-index: 100;
        transition: left 0.3s;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .message-content {
        max-width: 80%;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-primary { background: var(--primary); color: var(--white); }
.badge-success { background: var(--success); color: var(--white); }
.badge-warning { background: var(--warning); color: var(--white); }
.badge-danger { background: var(--danger); color: var(--white); }
/* Schedule Panel */
.schedule-panel {
    width: 350px;
    background: var(--white);
    border-left: 1px solid var(--light-2);
    display: none;
    flex-direction: column;
    transition: all 0.3s ease;
}

.schedule-panel.show {
    display: flex;
}

.schedule-header {
    padding: 20px;
    border-bottom: 1px solid var(--light-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.schedule-header h3 {
    margin: 0;
    font-size: 18px;
}

.schedule-info {
    padding: 15px;
    background: var(--light);
    border-bottom: 1px solid var(--light-2);
    font-size: 13px;
}

.schedule-dates {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.schedule-date-item {
    flex: 1;
}

.schedule-date-label {
    font-weight: 600;
    color: var(--dark-3);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.schedule-date-value {
    color: var(--dark);
    font-weight: 500;
}

.timeline-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.timeline-item {
    position: relative;
    padding-left: 30px;
    padding-bottom: 30px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: -8px;
    width: 2px;
    background: var(--light-2);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary);
    z-index: 1;
}

.timeline-marker.waiting {
    border-color: var(--dark-3);
}

.timeline-marker.in_progress {
    border-color: var(--warning);
}

.timeline-marker.done {
    border-color: var(--success);
    background: var(--success);
}

.timeline-content {
    background: var(--white);
    border: 1px solid var(--light-2);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-content:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
    font-size: 14px;
}

.timeline-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--dark-3);
    margin-top: 8px;
}

.timeline-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.timeline-status.waiting {
    background: #f3f4f6;
    color: #6b7280;
}

.timeline-status.in_progress {
    background: #fef3c7;
    color: #92400e;
}

.timeline-status.done {
    background: #d1fae5;
    color: #065f46;
}

.timeline-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
}

.timeline-assignee-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.timeline-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--dark-3);
}

.timeline-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Pin Details Modal */
.pin-details-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.pin-details-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pin-details-actions {
    display: flex;
    gap: 8px;
}

.pin-details-section {
    margin-bottom: 20px;
}

.pin-details-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-3);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.pin-details-value {
    color: var(--dark);
    line-height: 1.6;
}

.pin-comments {
    border-top: 1px solid var(--light-2);
    padding-top: 20px;
    margin-top: 20px;
}

.pin-comment {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.pin-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.pin-comment-content {
    flex: 1;
}

.pin-comment-author {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.pin-comment-text {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 4px;
}

.pin-comment-time {
    font-size: 11px;
    color: var(--dark-3);
}

.pin-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.pin-comment-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--light-2);
    border-radius: 8px;
    font-size: 14px;
}

.pin-comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--dark-3);
}

/* Responsive */
@media (max-width: 768px) {
    .schedule-panel {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 100%;
        max-width: 350px;
        z-index: 1000;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    }
}