/* Custom styles for BBD Shipping Management */
:root {
    --primary-color: #0056b3; /* Darker blue */
    --secondary-color: #6c757d;
    --accent-color: #28a745; /* Green for success/accent */
    --text-color: #343a40;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem; /* Reduced base font size */
    padding-top: 70px; /* Adjust for fixed navbar height */
    background-color: var(--light-bg);
    color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-top: 0.8rem;
    margin-bottom: 0.6rem;
}

h1 {
    font-size: 1.8rem; /* Adjusted h1 size */
}

.navbar {
    background-color: var(--dark-bg) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: 700;
    color: #fff !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 500;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

.dropdown-menu {
    background-color: var(--dark-bg);
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.75);
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

.card-header {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-bottom: none;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    padding: 0.75rem 1.25rem; /* Slightly more padding */
    font-size: 1.1rem; /* Slightly larger header font */
}

/* Dashboard card specific styles */
.card.text-white .card-title {
    font-size: 1.1rem; /* Larger title for dashboard cards */
    margin-bottom: 0.5rem;
}

.card.text-white .card-text.fs-2 {
    font-size: 2.5rem !important; /* More prominent numbers */
    font-weight: 700;
}

.card.text-white .card-footer {
    padding: 0.5rem 1.25rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.btn-primary:hover {
    background-color: #004085; /* Slightly darker primary */
    border-color: #004085;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    background-color: #117a8b;
    border-color: #117a8b;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: var(--text-color);
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #c82333;
}

.btn-success {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-success:hover {
    background-color: #218838;
    border-color: #218838;
}

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

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

.table thead th {
    background-color: var(--primary-color);
    color: #fff;
    border-bottom: 2px solid var(--primary-color);
    font-size: 0.8rem; /* Smaller font for table headers */
    padding: 0.6rem 0.4rem; /* Adjust padding */
    white-space: nowrap;
}

.table tbody td {
    font-size: 0.75rem; /* Even smaller font for table body */
    padding: 0.3rem; /* Reduced padding */
    white-space: nowrap; /* Prevent text wrapping in table cells */
    overflow: hidden; /* Hide overflow content */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
    max-width: 70px; /* Aggressively reduced max-width for general content cells */
}

.table tbody td:nth-child(1) { /* Voyage Code */
    max-width: 75px;
}

.table tbody td:nth-child(2) { /* Vessel */
    max-width: 90px;
}

.table tbody td:nth-child(3) { /* Charterer */
    max-width: 85px;
}

.table tbody td:nth-child(4), /* Loading Port */
.table tbody td:nth-child(5) { /* Discharging Port */
    max-width: 85px;
}

.table tbody td:nth-child(6), /* ETA POL */
.table tbody td:nth-child(7) { /* ETA POD */
    max-width: 100px; /* Increased max-width for ETA columns to prevent date/time wrapping */
}

.table tbody td:nth-last-child(2) { /* Status column */
    max-width: 80px; /* Adjusted max-width for status to allow badge text */
}

.table tbody td:last-child { /* Actions column */
    max-width: 140px; /* Adjusted max-width for action buttons column */
    white-space: nowrap; /* Keep action buttons on one line if possible */
    overflow: visible; /* Ensure all buttons are visible */
    text-overflow: clip; /* No ellipsis for action buttons */
    display: flex; /* Use flexbox for better alignment of buttons */
    align-items: center;
    justify-content: space-around; /* Distribute space around buttons */
}

.table .btn-sm {
    padding: 0.15rem 0.3rem; /* Even smaller buttons */
    font-size: 0.65rem; /* Even smaller font for buttons */
    margin-right: 0.1rem; /* Reduced space between buttons */
}

.table form.d-inline {
    display: inline-block !important; /* Ensure forms for buttons are inline */
}

.table .form-select-sm {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    font-size: 0.65rem;
    max-width: 90px; /* Limit width of status dropdown */
}

/* Styles for filter section buttons and inputs */
.d-flex .form-control.me-2,
.d-flex .form-select.me-2 {
    max-width: 130px; /* Reduced width for filter inputs */
    font-size: 0.8rem; /* Smaller font size for filter inputs */
    padding: 0.3rem 0.4rem; /* Adjusted padding */
}

.d-flex .btn {
    padding: 0.25rem 0.5rem; /* Reduced button padding */
    font-size: 0.8rem; /* Reduced button font size */
}


.table-hover tbody tr:hover {
    background-color: rgba(0, 86, 179, 0.1); /* Light hover effect */
}

.footer {
    position: relative; /* Changed from fixed to relative for better content flow */
    bottom: 0;
    width: 100%;
    padding: 15px 0;
    margin-top: 50px;
    background-color: var(--dark-bg);
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
}

/* Form elements styling */
.form-label {
    font-size: 0.85rem; /* Smaller font for form labels */
    margin-bottom: 0.25rem;
}

.form-control,
.form-select,
.form-control-plaintext {
    font-size: 0.85rem; /* Smaller font for form inputs and selects */
    padding: 0.375rem 0.75rem; /* Adjusted padding */
    height: auto; /* Allow height to adjust based on content */
}

.form-control.is-invalid {
    border-color: #dc3545;
}
.invalid-feedback {
    color: #dc3545;
    font-size: 0.8rem; /* Smaller font for validation feedback */
}

/* Status Badges */
.badge-status-Planned { background-color: #0d6efd; } /* Bootstrap primary */
.badge-status-In-Progress { background-color: #ffc107; color: #212529; } /* Bootstrap warning */
.badge-status-Completed { background-color: #28a745; } /* Bootstrap success */
.badge-status-Cancelled { background-color: #dc3545; } /* Bootstrap danger */
.badge-status-Pending { background-color: #6c757d; } /* Bootstrap secondary */
.badge-status-Overdue { background-color: #dc3545; } /* Bootstrap danger */
.badge-status-Paid { background-color: #28a745; } /* Bootstrap success */
