/**
 * CRM DUCKTOY - Custom Styles
 * Brand colors and responsive design
 */

/* ============================================
   GOOGLE FONTS - INTER
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --color-bg: #FFFFFF;
    --color-bg-light: #F9FAFB;
    --color-btn-bg: #000000;
    --color-btn-text: #FFFFFF;
    --color-link: #FFD600;
    /* Yellow from image */
    --color-link-hover: #E6C200;
    --color-text: #111827;
    --color-text-muted: #6B7280;
    --color-border: #E5E7EB;

    --color-sidebar-bg: #FFFFFF;
    --color-sidebar-active-bg: #FFD600;
    --color-sidebar-active-text: #000000;

    --color-success: #10B981;
    --color-danger: #EF4444;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;

    --font-regular: 'Inter', sans-serif;
    --font-bold: 'Inter', sans-serif;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Override Bootstrap Primary */
.text-primary {
    color: var(--color-link) !important;
}

.bg-primary {
    background-color: var(--color-link) !important;
}

.btn-primary {
    background-color: var(--color-btn-bg) !important;
    border-color: var(--color-btn-bg) !important;
}

.btn-outline-primary {
    color: var(--color-link) !important;
    border-color: var(--color-link) !important;
}

.btn-outline-primary:hover {
    background-color: var(--color-link) !important;
    border-color: var(--color-link) !important;
    color: #FFF !important;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-regular);
    font-weight: 400;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-bold);
    font-weight: 700;
    margin-bottom: 1rem;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-link-hover);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-dark {
    background-color: var(--color-btn-bg) !important;
    border-color: var(--color-btn-bg) !important;
    color: var(--color-btn-text) !important;
    font-family: var(--font-bold);
    font-weight: 700;
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-dark:hover {
    background-color: #333333 !important;
    border-color: #333333 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
    border-color: var(--color-btn-bg) !important;
    color: var(--color-btn-bg) !important;
    font-family: var(--font-bold);
    font-weight: 700;
}

.btn-outline-primary:hover {
    background-color: var(--color-btn-bg) !important;
    color: var(--color-btn-text) !important;
}

.btn-link {
    color: var(--color-link) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.btn-link:hover {
    color: var(--color-link-hover) !important;
    text-decoration: none !important;
}

/* Touch-friendly buttons for mobile */
@media (max-width: 768px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
    }
}

/* ============================================
   FORMS
   ============================================ */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid var(--color-border);
    padding: 0.625rem 0.875rem;
    font-family: var(--font-regular);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-link);
    box-shadow: 0 0 0 0.2rem rgba(212, 160, 23, 0.25);
}

.form-label {
    font-family: var(--font-bold);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

/* Touch-friendly inputs for mobile */
@media (max-width: 768px) {

    .form-control,
    .form-select {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
}

/* ============================================
   NAVIGATION & SIDEBAR
   ============================================ */
/* ============================================
   NAVIGATION & SIDEBAR
   ============================================ */
.sidebar {
    background-color: var(--color-sidebar-bg);
    min-height: 100vh;
    padding: 1.5rem 1rem;
    border-right: none;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0 0.5rem 2rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background-color: var(--color-link);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #000;
}

.sidebar .nav {
    flex-grow: 1;
}

.sidebar .nav-link {
    color: #4B5563;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: var(--color-bg-light);
    color: #111827;
}

.sidebar .nav-link.active {
    background-color: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-active-text);
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4B5563;
}

/* Mobile sidebar */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        background: #fff;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
}

.navbar-brand {
    font-family: var(--font-bold);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-text) !important;
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* ============================================
   CARDS
   ============================================ */
/* ============================================
   CARDS
   ============================================ */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
    background-color: #fff;
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    font-family: var(--font-regular);
}

.table thead th {
    font-family: var(--font-bold);
    font-weight: 700;
    border-bottom: 2px solid var(--color-border);
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(212, 160, 23, 0.05);
}

/* Responsive table for mobile */
@media (max-width: 768px) {
    .table-responsive {
        border: 1px solid var(--color-border);
        border-radius: 0.375rem;
    }
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-family: var(--font-bold);
    font-weight: 700;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
}

.toast {
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.toast-header {
    font-family: var(--font-bold);
    font-weight: 700;
}

@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ============================================
   KANBAN BOARD
   ============================================ */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
}

.kanban-column {
    min-width: 280px;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
}

.kanban-column-header {
    font-family: var(--font-bold);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.kanban-card {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: move;
    transition: box-shadow 0.3s ease;
}

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

.kanban-card.dragging {
    opacity: 0.5;
}

/* Drag & Drop States */
.kanban-card-ghost {
    opacity: 0.4;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.kanban-card-drag {
    opacity: 0.8;
    transform: rotate(2deg);
    cursor: grabbing !important;
}

.kanban-card {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-cards {
    min-height: 100px;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted {
    color: var(--color-text-muted) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--color-border) !important;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.login-card {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================================
   CONTACTS LIST SPLIT VIEW
   ============================================ */
.contact-list-item {
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.contact-list-item:hover {
    background-color: var(--color-bg-light);
}

.contact-list-item.active {
    background-color: #FEF9C3 !important;
    /* light yellow */
    border-left-color: var(--color-link);
}

.avatar-circle {
    font-size: 0.875rem;
    color: var(--color-text);
}

.avatar-circle-lg {
    font-size: 1.5rem;
    color: var(--color-text);
}

.master-detail-card {
    transition: none !important;
}

/* ============================================
   COMPANY CARDS
   ============================================ */
.company-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-footer-link {
    transition: color 0.2s ease;
}

/* ============================================
   KANBAN BOARD REDESIGN
   ============================================ */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    min-width: 300px;
    width: 300px;
    background: transparent;
}

.kanban-column-header {
    border-radius: var(--border-radius-md);
}

/* Background colors for column headers (subtle variants) */
:root {
    --color-primary-subtle: #cfe2ff;
    --color-success-subtle: #d1e7dd;
    --color-warning-subtle: #fff3cd;
    --color-danger-subtle: #f8d7da;
    --color-info-subtle: #cff4fc;
}

.kanban-card {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    cursor: grab;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.kanban-card:active {
    cursor: grabbing;
}