/* CRM SaaS - App Styles */

/* CSS Custom Properties */
:root {
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
}

/* Global */
* { box-sizing: border-box; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar - Modern thin style */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #334155; }

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.animate-slide-in { animation: slideIn 0.3s ease-out; }
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-scale-in { animation: scaleIn 0.3s ease-out; }
.animate-pulse-slow { animation: pulse-slow 6s ease-in-out infinite; }

/* Modal show animation */
.modal-active #modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Transitions */
.transition-height { transition: max-height var(--transition-slow), opacity var(--transition-slow); }

/* Kanban board */
.kanban-column { transition: all var(--transition-base); }
.kanban-column:hover { border-color: #c7d2fe; }

.deal-card {
    transition: all var(--transition-base);
}
.deal-card:active {
    cursor: grabbing;
}

/* Sortable Ghosts */
.sortable-ghost {
    opacity: 0.3 !important;
    background: #e0e7ff !important;
}
.sortable-drag {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
    transform: rotate(2deg) !important;
}

/* Status colors */
.status-new { color: #3b82f6; background: #dbeafe; }
.status-contacted { color: #d97706; background: #fef3c7; }
.status-qualified { color: #7c3aed; background: #ede9fe; }
.status-won { color: #059669; background: #d1fae5; }
.status-lost { color: #dc2626; background: #fee2e2; }

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

/* Table hover */
table tbody tr {
    transition: background-color var(--transition-fast);
}

/* Button press effect */
button:active { transform: scale(0.98); }
a.btn:active { transform: scale(0.98); }

/* Loading spinner */
.spinner {
    border: 2px solid #e2e8f0;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive sidebar */
@media (max-width: 1024px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.sidebar-open { transform: translateX(0); }
    #main-content { margin-left: 0 !important; }
}

/* Print styles */
@media print {
    #sidebar, header, .no-print { display: none !important; }
    #main-content { margin-left: 0 !important; }
    body { background: white; }
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    animation: fadeIn 0.15s ease;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}

/* Number input - hide spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }
