/* ClientPulse CRM - Custom Styles */
/* Minimal additions to complement Tailwind CSS */

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ============================================
   Sidebar Navigation Transitions
   ============================================ */
.nav-link {
    transition: all 0.15s ease-in-out;
}

/* ============================================
   Card Hover Effects
   ============================================ */
.card-hover {
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.card-hover:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   Table Improvements
   ============================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    min-width: 800px;
}

/* ============================================
   Input Focus Styling
   ============================================ */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dark input:focus,
.dark select:focus,
.dark textarea:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ============================================
   Checkbox Styling
   ============================================ */
input[type="checkbox"] {
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

/* ============================================
   Modal Animations
   ============================================ */
[data-modal] {
    animation: fadeIn 0.15s ease-out;
}

[data-modal] > div {
    animation: slideIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
    transition: width 0.5s ease-in-out;
}

/* ============================================
   Skeleton Loading Animation
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Kanban Board Drag Styles
   ============================================ */
.kanban-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
}

.kanban-column.drag-over {
    background-color: rgba(99, 102, 241, 0.05);
}

/* ============================================
   Activity Timeline
   ============================================ */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.125rem;
    top: 2.5rem;
    bottom: -0.5rem;
    width: 2px;
    background-color: #e5e7eb;
}

.dark .timeline-item::before {
    background-color: #374151;
}

.timeline-item:last-child::before {
    display: none;
}

/* ============================================
   Badge Pulse Animation (for notifications)
   ============================================ */
.badge-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   Dropdown Menu Animation
   ============================================ */
[data-dropdown-menu]:not(.hidden) {
    animation: dropdownSlide 0.15s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Stat Card Number Animation
   ============================================ */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-full-width {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ============================================
   Mobile Touch Improvements
   ============================================ */
@media (max-width: 768px) {
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   Focus Visible (Keyboard Navigation)
   ============================================ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ============================================
   Tooltip Styles (optional enhancement)
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 50;
    margin-bottom: 0.5rem;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}
