/* Custom Styles for Regalia Travels CRM */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    padding: 1rem 1.25rem;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.table th {
    background-color: var(--light-color);
    border-top: none;
    font-weight: 600;
    color: var(--primary-color);
}

.badge {
    font-size: 0.75em;
}

.status-new { background-color: var(--info-color); }
.status-contacted { background-color: var(--warning-color); }
.status-proposal { background-color: #9b59b6; }
.status-negotiation { background-color: #e67e22; }
.status-booked { background-color: var(--success-color); }
.status-completed { background-color: #34495e; }
.status-lost { background-color: var(--danger-color); }

.dashboard-card {
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.metric-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.metric-card .metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.metric-card .metric-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    opacity: 0.95;
}

.metric-card p {
    margin-bottom: 0;
    opacity: 0.9;
}

.btn-sm-custom {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 0 2px;
}

.table-actions {
    white-space: nowrap;
    width: 1%;
}

.modal-lg {
    max-width: 900px;
}

.form-floating {
    margin-bottom: 1rem;
}

.pipeline-stage {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 0.5rem;
    background-color: white;
    border: 2px dashed #dee2e6;
    min-height: 200px;
}

.pipeline-stage.active {
    border-color: var(--secondary-color);
    background-color: #f8f9ff;
}

.pipeline-card {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pipeline-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-box {
    position: relative;
}

.search-box .fa-search {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    padding-left: 40px;
}

.filter-section {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.alert-expiry {
    border-left: 4px solid var(--warning-color);
    background-color: #fff3cd;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.alert-urgent {
    /* Enhanced styling - see ui-components.css for full styles */
    border-left: 5px solid #e53e3e;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.15);
    transition: all 0.3s ease;
}

.performance-card {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.performance-card h4 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    padding: 2rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.65rem;
    }
    
    .metric-card h3 {
        font-size: 2rem;
    }
}

.datatables-wrapper {
    padding: 1rem;
}

.dataTables_filter input {
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

.dataTables_length select {
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

.page-link {
    color: var(--secondary-color);
}

.page-item.active .page-link {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.whatsapp-btn {
    background-color: #25d366;
    border-color: #25d366;
    color: white;
}

.whatsapp-btn:hover {
    background-color: #128c7e;
    border-color: #128c7e;
    color: white;
}

.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.activity-item {
    position: relative;
    padding-bottom: 1rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--secondary-color);
}

/* Custom Visa Expiry Alert Colors - Lighter & Softer */
.visa-urgent {
    color: #ff6b6b !important; /* Soft coral red */
    font-weight: bold;
    animation: pulse 2s infinite;
}

.visa-warning {
    color: #ffa726 !important; /* Soft orange */
    font-weight: 600;
}

.visa-caution {
    color: #ffcc02 !important; /* Bright but soft yellow */
    font-weight: 500;
}

.visa-info {
    color: #42a5f5 !important; /* Soft blue */
    font-weight: normal;
}

/* Pulse animation for very urgent items */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Enhanced alert containers */
.alert-urgent {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-left: 4px solid #e53e3e;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-left: 4px solid #38a169;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.1);
}

/* ============================================
   MODAL OPTIMIZATION STYLES
   ============================================ */

/* Make modals more compact */
.modal-dialog {
    max-width: 850px !important;
}

/* Scrollable modal body - CRITICAL for scroll to work */
.modal-body {
    max-height: 65vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0.6rem 1rem !important;
}

/* First section - remove extra top margin */
.modal-body > h6:first-child,
.modal-body > .row:first-child,
.modal-body > div:first-child {
    margin-top: 0 !important;
}

/* Compact form spacing in modals */
.modal-body .mb-3 {
    margin-bottom: 0.45rem !important;
}

.modal-body .mb-2 {
    margin-bottom: 0.35rem !important;
}

.modal-body .row {
    margin-bottom: 0;
    row-gap: 0;
    margin-left: -0.3rem;
    margin-right: -0.3rem;
}

.modal-body .col-md-6,
.modal-body .col-md-4,
.modal-body .col-md-3,
.modal-body .col-md-12,
.modal-body .col-12 {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

.modal-body h6 {
    margin-top: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: #2c3e50;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-body h5 {
    margin-top: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-body hr {
    margin: 0.5rem 0 0.45rem 0;
    opacity: 0.3;
}

/* Compact form controls in modals */
.modal-body .form-control,
.modal-body .form-select {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.8125rem !important;
    height: calc(1.5em + 0.7rem + 2px) !important;
    line-height: 1.4;
    border-width: 1px;
}

.modal-body textarea.form-control {
    height: auto !important;
    min-height: 65px !important;
    resize: vertical;
}

.modal-body .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Compact floating labels */
.modal-body .form-floating {
    margin-bottom: 0.45rem !important;
}

.modal-body .form-floating > label {
    padding: 0.5rem 0.5rem !important;
    font-size: 0.75rem !important;
    opacity: 0.7;
    line-height: 1.3;
}

.modal-body .form-floating > .form-control,
.modal-body .form-floating > .form-select {
    padding: 0.5rem 0.5rem !important;
    height: calc(2.2rem + 2px) !important;
    font-size: 0.8125rem !important;
    line-height: 1.4;
}

.modal-body .form-floating > .form-control:focus ~ label,
.modal-body .form-floating > .form-control:not(:placeholder-shown) ~ label,
.modal-body .form-floating > .form-select ~ label {
    transform: scale(0.75) translateY(-0.5rem) translateX(0.1rem);
    padding: 0.2rem 0.4rem !important;
}

/* Compact select2 dropdowns in modals */
.modal-body .select2-container .select2-selection--single {
    height: calc(1.5em + 0.7rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
}

.modal-body .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5em + 0.7rem) !important;
    padding-left: 0 !important;
    font-size: 0.8125rem !important;
}

.modal-body .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.7rem + 2px) !important;
}

.modal-body .select2-container {
    font-size: 0.8125rem !important;
}

/* Compact visa/checkbox sections */
.modal-body .visa-entry {
    padding: 0.45rem !important;
    margin-bottom: 0.45rem !important;
}

.modal-body .border.rounded.p-2 {
    padding: 0.4rem !important;
}

.modal-body .border.rounded.p-3 {
    padding: 0.45rem !important;
}

.modal-body .form-check {
    padding-left: 1.3rem;
    margin-bottom: 0.25rem;
    min-height: 1.2rem;
}

.modal-body .form-check-input {
    width: 0.9rem;
    height: 0.9rem;
    margin-top: 0.1rem;
}

.modal-body .form-check-label {
    font-size: 0.8rem;
    margin-left: 0.2rem;
    line-height: 1.3;
}

.modal-body .form-check-sm {
    font-size: 0.75rem;
}

.modal-body .form-check-inline {
    margin-right: 0.6rem;
    margin-bottom: 0.35rem;
}

/* Compact input groups */
.modal-body .input-group {
    font-size: 0.8125rem;
}

.modal-body .input-group-text {
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
}

/* Compact buttons in modals */
.modal-body .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.modal-body .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

/* Compact small text */
.modal-body .form-text,
.modal-body .text-muted,
.modal-body small {
    font-size: 0.7rem;
    line-height: 1.3;
}

/* Compact modal header */
.modal-header {
    padding: 0.5rem 1rem !important;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    min-height: auto;
}

.modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.modal-title i {
    font-size: 0.85rem;
}

.modal-header .btn-close {
    padding: 0.3rem;
    margin: -0.3rem -0.3rem -0.3rem auto;
    font-size: 0.8rem;
}

/* Compact modal footer */
.modal-footer {
    padding: 0.5rem 1rem !important;
    background-color: #f8f9fa;
}

.modal-footer .btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
}

/* Responsive modal sizes */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: 96% !important;
        margin: 0.4rem auto;
    }
    
    .modal-body {
        max-height: 60vh !important;
        padding: 0.5rem 0.7rem !important;
    }
    
    .modal-header {
        padding: 0.4rem 0.7rem !important;
    }
    
    .modal-footer {
        padding: 0.4rem 0.7rem !important;
    }
    
    .modal-body .col-md-6,
    .modal-body .col-md-4,
    .modal-body .col-md-3 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .modal-body .form-floating > .form-control,
    .modal-body .form-floating > .form-select {
        font-size: 0.8rem !important;
    }
    
    .modal-title {
        font-size: 0.85rem;
    }
}

/* Better scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
    margin: 4px 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
    border: 2px solid #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure modal content allows scrolling */
.modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
}

