/* =====================================================
   CRM PRO - DRAWER STYLES
   ===================================================== */

/* Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer Container */
.drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer.open {
    right: 0;
}

/* Drawer Header */
.drawer-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    position: relative;
}

.drawer-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.drawer-close svg {
    width: 18px;
    height: 18px;
}

/* Drawer Profile */
.drawer-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.drawer-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.drawer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drawer-profile-info h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.drawer-profile-info p {
    margin: 4px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Quick Actions */
.drawer-quick-actions {
    display: flex;
    gap: 10px;
}

.quick-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.quick-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Drawer Tabs */
.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    overflow-x: auto;
}

.drawer-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.drawer-tab:hover {
    color: var(--primary-500);
    background: var(--bg-hover);
}

.drawer-tab.active {
    color: var(--primary-500);
    border-bottom-color: var(--primary-500);
}

.drawer-tab svg {
    width: 18px;
    height: 18px;
}

/* Drawer Body */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.drawer-tab-content {
    display: none;
}

.drawer-tab-content.active {
    display: block;
}

/* Info Sections */
.info-section {
    margin-bottom: 24px;
}

.info-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
}

.info-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag {
    padding: 4px 10px;
    background: var(--primary-50);
    color: var(--primary-600);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.btn-add-tag {
    padding: 4px 10px;
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-tag:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
}

/* Notes */
.notes-text {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Empty Tab */
.empty-tab {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-tab svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-tab p {
    margin-bottom: 16px;
}

/* Appointments List */
.appointments-list,
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointment-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-500);
}

.appointment-item.completed {
    opacity: 0.6;
    border-left-color: var(--success-500);
}

.appointment-item.cancelled {
    opacity: 0.5;
    border-left-color: var(--text-secondary);
    text-decoration: line-through;
}

.apt-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    font-size: 12px;
}

.apt-date {
    font-weight: 600;
    color: var(--primary-500);
}

.apt-hour {
    color: var(--text-secondary);
}

.apt-info {
    flex: 1;
}

.apt-info h5 {
    margin: 0 0 4px;
    font-size: 14px;
}

.apt-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.apt-info svg {
    width: 12px;
    height: 12px;
}

.apt-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Reminder Item */
.reminder-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    align-items: flex-start;
}

.reminder-item.done {
    opacity: 0.6;
}

.reminder-item.done h5 {
    text-decoration: line-through;
}

.reminder-item.overdue {
    border-left: 3px solid var(--danger-500);
}

.reminder-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.reminder-info {
    flex: 1;
}

.reminder-info h5 {
    margin: 0 0 4px;
    font-size: 14px;
}

.reminder-time {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.reminder-time svg {
    width: 12px;
    height: 12px;
}

.reminder-note {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-icon {
    position: absolute;
    left: -30px;
    width: 24px;
    height: 24px;
    background: var(--bg-primary);
    border: 2px solid var(--primary-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-icon svg {
    width: 12px;
    height: 12px;
    color: var(--primary-500);
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
}

.timeline-content p {
    margin: 0 0 4px;
    font-size: 14px;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Drawer Footer */
.drawer-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: var(--bg-primary);
}

.drawer-footer .btn {
    flex: 1;
}

.btn-danger-outline {
    background: none;
    border: 1px solid var(--danger-500);
    color: var(--danger-500);
}

.btn-danger-outline:hover {
    background: var(--danger-50);
}

/* Button icon small */
.btn-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    background: var(--bg-hover);
    color: var(--primary-500);
}

.btn-icon-sm svg {
    width: 14px;
    height: 14px;
}

/* Tag Suggestions */
.suggested-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag-suggestion {
    padding: 4px 10px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tag-suggestion:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
    background: var(--primary-50);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .drawer {
        width: 100vw;
        right: -100vw;
    }
}

/* Utility classes */
.mb-3 {
    margin-bottom: 12px;
}

.text-muted {
    color: var(--text-secondary);
}