/* public/css/custom.css */
:root {
    --primary: #c9104f;
    --primary-light: #e03a75;
    --primary-dark: #a00d3f;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
}

/* Global styles */
body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-900);
}

/* Navigation - Ensure it stays at the top */
.navbar {
    background-color: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative !important;
    top: 0 !important;
    z-index: 1030 !important;
}

/* Ensure proper page layout */
#app {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

main {
    flex: 1 !important;
}

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

/* Icon-top navigation styles */
.nav-icon-top .nav-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.5rem 1rem !important;
    min-width: 80px;
    color: var(--gray-700) !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-icon-top .nav-link i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    display: block;
}

.nav-icon-top .nav-link span {
    font-size: 0.85rem;
    display: block;
    white-space: nowrap;
}

.nav-icon-top .nav-link:hover,
.nav-icon-top .nav-link.active {
    color: var(--primary) !important;
    background-color: rgba(201, 16, 79, 0.05);
    border-radius: 8px;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--primary) !important;
}

.navbar-dark .navbar-toggler {
    border-color: var(--gray-300);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .nav-icon-top .nav-link {
        flex-direction: row !important;
        justify-content: flex-start !important;
        text-align: left !important;
        min-width: auto;
    }
    
    .nav-icon-top .nav-link i {
        font-size: 1.2rem;
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
    
    .nav-icon-top .nav-link span {
        font-size: 1rem;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

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

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

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(201, 16, 79, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(201, 16, 79, 0.3);
}

.btn-secondary {
    background-color: var(--gray-600);
    border-color: var(--gray-600);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--gray-700);
    border-color: var(--gray-700);
}

.btn-warning {
    color: white;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn-warning:hover, .btn-warning:focus {
    color: white;
}

.btn-info {
    color: white;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.btn-danger {
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn {
    border-radius: 5px;
    font-weight: 500;
    padding: 0.375rem 1rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

/* Tables */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table thead th {
    border-top: none;
    border-bottom: 2px solid var(--primary);
    color: var(--gray-700);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(201, 16, 79, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(201, 16, 79, 0.05);
}

/* Forms */
.form-control, .form-select {
    border-radius: 5px;
    border: 1px solid var(--gray-300);
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(201, 16, 79, 0.25);
}

.form-label {
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 10px;
}

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

/* Dashboard */
.dashboard-card {
    border-radius: 8px;
    padding: 1.5rem;
    height: 100%;
}

.dashboard-card h5 {
    color: var(--primary);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* List group */
.list-group-item {
    border-color: var(--gray-200);
    padding: 1rem 1.25rem;
}

.list-group-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.list-group-item-action:hover {
    background-color: rgba(201, 16, 79, 0.05);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Dashboard stage cards */
.stage-card {
    border-left: 4px solid var(--primary);
    background-color: white;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.page-link {
    color: var(--primary);
}

.page-link:hover {
    color: var(--primary-dark);
}

/* Footer - Ensure it stays at the bottom */
footer {
    margin-top: auto !important;
    padding: 1rem 0;
    background-color: white;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    text-align: center;
    font-size: 0.875rem;
    flex-shrink: 0 !important;
}

/* Custom project status badges */
.status-prospecting {
    background-color: #6c757d;
}

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

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

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

.status-closed-lost, .status-cancelled, .status-no-bid {
    background-color: #dc3545;
}

.status-hibernation {
    background-color: #6610f2;
}

/* Animation for loader */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader {
    border: 4px solid var(--gray-200);
    border-radius: 50%;
    border-top: 4px solid var(--primary);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

.line-item-row {
    cursor: pointer;
}

#lineItemTooltip {
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
    opacity: 0;
    border: 1px solid #dee2e6;
}

#lineItemTooltip.visible {
    opacity: 1;
}

.tooltip-table {
    font-size: 0.85rem;
}

.tooltip-table th {
    text-align: right;
    vertical-align: top;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
}

.tooltip-table td {
    padding: 2px 0;
}

/* Add this to custom.css if you want different colors for different project stages */
.stage-prospecting { border-left-color: #6c757d; }
.stage-proposal { border-left-color: #17a2b8; }
.stage-submitted { border-left-color: #fd7e14; }
.stage-closed-won { border-left-color: #28a745; }
.stage-closed-lost { border-left-color: #dc3545; }

/* Hide number input spinners (arrows) */
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; /* Firefox */
  appearance: textfield; /* Newer browsers */
}