/* Helix CRM Custom Styles */

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fc;
    color: #5a5c69;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    border-radius: 10px 10px 0 0 !important;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    border: none;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #d1d3e2;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    background-color: #f8f9fc;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Statistics Cards */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: 4px;
}

/* Phone Links */
.phone-link {
    color: #28a745;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.phone-link:hover {
    color: #1e7e34;
    text-decoration: underline !important;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 10px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-marker {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #667eea;
}

.timeline-content {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Avatar Circles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

/* Dashboard Stats */
.text-xs {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Login Page */
.login-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Loading Spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .timeline {
        padding-left: 20px;
    }
    
    .timeline::before {
        left: -20px;
    }
    
    .timeline-marker {
        left: -25px;
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 576px) {
    .d-grid .btn {
        margin-bottom: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .card-header,
    .pagination {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }
    
    .table {
        color: #e0e0e0;
    }
    
    .form-control,
    .form-select {
        background-color: #3d3d3d;
        color: #e0e0e0;
        border-color: #555;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hover Effects */
.hover-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Status Specific Colors */
.status-new {
    background-color: #007bff;
}

.status-contacted {
    background-color: #17a2b8;
}

.status-meeting {
    background-color: #ffc107;
}

.status-proposal {
    background-color: #fd7e14;
}

.status-closed {
    background-color: #28a745;
}

.status-cancelled {
    background-color: #dc3545;
}

/* Priority Colors */
.priority-low {
    background-color: #6c757d;
}

.priority-medium {
    background-color: #17a2b8;
}

.priority-high {
    background-color: #dc3545;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Utility Classes */
.text-primary-custom {
    color: #667eea !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.border-primary-custom {
    border-color: #667eea !important;
}

.shadow-custom {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(102, 126, 234, 0.15) !important;
}

.rounded-custom {
    border-radius: 10px !important;
}

/* Module Permission Icons */
.permission-icons i {
    margin: 0 3px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.permission-icons i:hover {
    transform: scale(1.2);
}

/* Module Headers in Permission Table */
.module-header {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    min-width: 60px;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 10px 5px;
}

@media (max-width: 768px) {
    .module-header {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        min-width: auto;
    }
}

/* Footer */
footer {
    background-color: #f8f9fc;
    border-top: 1px solid #e3e6f0;
    margin-top: auto;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.message-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
    border-left: 4px solid #dc3545;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Chart Containers */
.chart-area {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-pie {
    position: relative;
    height: 15rem;
    width: 100%;
}

/* Custom Select Dropdown */
.custom-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Tooltip Customization */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: #667eea;
    border-radius: 6px;
}

.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #667eea;
}

.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #667eea;
}

.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #667eea;
}

.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #667eea;
}
