/* TinnaLeads CRM - Custom Styles */
/* Light theme (default) + Dark theme support */

:root,
[data-bs-theme="light"] {
    --tl-primary: #0d6efd;
    --tl-bg: #f8f9fa;
    --tl-card-bg: #ffffff;
    --tl-card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --tl-card-shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
    --tl-border: #dee2e6;
    --tl-scrollbar-track: #f0f0f0;
    --tl-scrollbar-thumb: #c1c1c1;
    --tl-progress-bg: rgba(0,0,0,0.08);
}

[data-bs-theme="dark"] {
    --tl-bg: #1a1d21;
    --tl-card-bg: #212529;
    --tl-card-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --tl-card-shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
    --tl-border: #2d3238;
    --tl-scrollbar-track: #141619;
    --tl-scrollbar-thumb: #2d3238;
    --tl-progress-bg: rgba(255,255,255,0.1);
}

body {
    background-color: var(--tl-bg);
}

/* Sidebar - always dark */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    background-color: #1a1d21;
    border-right: 1px solid #2d3238;
    flex-shrink: 0;
    min-width: 250px;
}

/* Main content must respect sidebar width */
.sidebar + .flex-grow-1 {
    min-width: 0;
    max-width: calc(100% - 250px);
}

.sidebar .nav-link {
    padding: 0.6rem 1rem;
    margin: 2px 0;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
}

.sidebar .nav-link:hover {
    background: rgba(13, 110, 253, 0.15);
    color: #fff;
}

.sidebar .nav-link.active {
    font-weight: 600;
    color: #fff;
}

.sidebar .border-bottom {
    border-color: #2d3238 !important;
}

/* Navbar */
.app-navbar {
    border-bottom: 1px solid var(--tl-border);
}

/* Cards */
.card {
    border-radius: 8px;
    box-shadow: var(--tl-card-shadow);
    border-color: var(--tl-border);
}

.card-header {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
}

/* Progress bars */
.progress {
    border-radius: 10px;
    background: var(--tl-progress-bg);
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--tl-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Alerts */
.alert {
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar + .flex-grow-1 {
        max-width: 100%;
        width: 100% !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--tl-scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--tl-scrollbar-thumb);
    border-radius: 3px;
}

/* Stats cards hover effect */
.card:hover {
    box-shadow: var(--tl-card-shadow-hover);
    transition: box-shadow 0.2s;
}

/* Input group styling */
.input-group-text {
    font-size: 0.85rem;
}

/* Page transitions */
main {
    animation: fadeIn 0.2s ease-in;
}

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