/* Custom styles for Tuullboxx Web Development application */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --primary-rgb: 13, 110, 253;
    --success-rgb: 25, 135, 84;
    --info-rgb: 13, 202, 240;
    --warning-rgb: 255, 193, 7;
    --danger-rgb: 220, 53, 69;
    --transition-speed: 0.3s;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    --card-hover-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f3f5f9;
    color: #344767;
}

.container {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

/* Navbar */
.navbar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 50%, #d63384 100%) !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
    /* backdrop-filter removed to fix mobile menu wrapping context/z-index issues */
    z-index: 1051;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 50rem;
    padding: 0.5rem 1rem !important;
    /* Override bootstrap px-3 if needed or complement it */
    margin: 0 0.25rem;
    position: relative;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.3px;
    font-size: 1.35rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Logo Styling */
.navbar-logo {
    height: 50px;
    width: auto;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: white;
    padding: 0;
}

.navbar-logo:hover {
    transform: rotate(-3deg) scale(1.1);
    border-color: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Mobile Nav Fixes */
@media (max-width: 991.98px) {

    /* Fix for invisible links: Apply gradient background to the mobile drawer */
    #offcanvasNav.offcanvas-lg {
        background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 50%, #d63384 100%) !important;
        position: fixed !important;
        /* Force fixed positioning */
        top: 0;
        bottom: 0;
        right: 0;
        z-index: 10000 !important;
        /* Insanely high Z-Index to beat everything */
        height: 100vh;
        /* Fallback */
        height: 100dvh;
        /* Modern mobile browser viewport height */
        width: 300px;
        /* Standardize width */
        visibility: hidden;
        /* Default hidden */
        transform: translateX(100%);
        /* Default off-screen */
        transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }

    #offcanvasNav .offcanvas-body {
        padding-bottom: 6rem !important;
        /* Extra padding to clear mobile browser bottom bars */
        overflow-y: auto !important;
    }

    #offcanvasNav.offcanvas-lg.show {
        visibility: visible !important;
        transform: none !important;
    }

    /* Force links to be visible white block elements */
    #offcanvasNav .nav-link {
        color: #ffffff !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        /* Subtle separator for links */
    }

    #offcanvasNav .nav-link:hover {
        background: rgba(255, 255, 255, 0.2) !important;
    }

    /* Style the user profile section to match */
    #offcanvasNav .border-top {
        border-top-color: rgba(255, 255, 255, 0.2) !important;
        /* Lighter border for gradient */
    }

    #offcanvasNav .text-white-50 {
        color: rgba(255, 255, 255, 0.7) !important;
        /* Ensure readability */
    }

    /* Ensure specific buttons inside mobile menu pop correctly */
    #offcanvasNav .btn-light {
        background: #fff !important;
        color: #dc3545 !important;
        /* Ensure red text for sign out */
        border: none !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;
    }

    /* Override standard offcanvas background if necessary */
    .offcanvas-start,
    .offcanvas-end,
    .offcanvas-top,
    .offcanvas-bottom {
        background-color: transparent !important;
    }

    .navbar .offcanvas-backdrop {
        z-index: 9999 !important;
    }
}

/* Card styling */
.card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--card-shadow);
    border-radius: 1rem;
    overflow: hidden;
    background-color: #fff;
    margin-bottom: 1.5rem;
    background: #fff;
    /* Fallback */
}

/* Gradient borders for cards (optional sophisticated look) */
.card-gradient-border {
    position: relative;
    background: #fff;
    background-clip: padding-box;
    border: 1px solid transparent;
}

.card-gradient-border::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    margin: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, #0d6efd, #6f42c1, #d63384);
}

/* Gradient Utilities */
.bg-gradient-primary-soft {
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 50%, #d63384 100%) !important;
}

.text-gradient {
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 50%, #d63384 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 50%, #d63384 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover,
.btn-gradient-primary:focus {
    background: linear-gradient(135deg, #0b5ed7 0%, #59359a 50%, #ad2a6a 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    /* Smoother deep shadow */
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Enhanced Gradients for Headers */
.card-header.bg-primary {
    background: linear-gradient(120deg, #0d6efd 0%, #0a58ca 100%) !important;
    box-shadow: 0 4px 6px -1px rgba(13, 110, 253, 0.2);
}

.card-header.bg-success {
    background: linear-gradient(120deg, #198754 0%, #146c43 100%) !important;
    box-shadow: 0 4px 6px -1px rgba(25, 135, 84, 0.2);
}

.card-header.bg-warning {
    background: linear-gradient(120deg, #ffc107 0%, #fd7e14 100%) !important;
    /* Added orange tilt for richness */
    color: #fff !important;
    /* Ensure text is readable */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-header.bg-info {
    background: linear-gradient(120deg, #0dcaf0 0%, #0d6efd 100%) !important;
    color: #fff !important;
}

.card-header.bg-secondary {
    background: linear-gradient(120deg, #6c757d 0%, #495057 100%) !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger animations for lists */
.list-group-item {
    transition: background-color 0.2s, transform 0.2s;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    z-index: 1;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #8bb9fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #0bb5d8 100%);
    border: none;
    color: white;
}

/* Soft Badges */
.badge {
    padding: 0.55em 0.85em;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.badge-soft-primary {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: #0d6efd;
}

.badge-soft-success {
    background-color: rgba(var(--success-rgb), 0.1);
    color: #198754;
}

.badge-soft-warning {
    background-color: rgba(var(--warning-rgb), 0.1);
    color: #997404;
    /* Darker for readability */
}

.badge-soft-danger {
    background-color: rgba(var(--danger-rgb), 0.1);
    color: #dc3545;
}

.badge-soft-info {
    background-color: rgba(var(--info-rgb), 0.1);
    color: #0dcaf0;
    /* may need darkening */
    color: #055160;
}

.badge-soft-secondary {
    background-color: #e9ecef;
    color: #5c636a;
}

/* Table styling */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #8898aa;
    border-bottom-width: 1px;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

.table td {
    padding: 1.2rem 1.5rem;
    vertical-align: middle;
    color: #4b5563;
    border-bottom: 1px solid #f2f4f6;
    font-size: 0.95rem;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f1f3f9;
}

.input-group-text {
    background-color: #ffffff;
    border-color: #dee2e6;
    color: #6c757d;
    border-right: none;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    box-shadow: none;
    border-color: #dee2e6;
    border-left: 1px solid #dee2e6;
    /* Reset on focus if needed or handle focus ring on group */
}

.input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    border-radius: 0.5rem;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: #8bb9fe;
}

/* Avatar/Profile styling hint */
.avatar-initial {
    width: 36px;
    height: 36px;
    background-color: #e9ecef;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    margin-right: 0.75rem;
}

.login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 420px;
    width: 100%;
}

/* Brand Logo Styling */
.brand-logo {
    max-width: 150px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.animate-logo {
    animation: fadeIn 0.8s ease-out;
}

/* Map styling */
#map {
    border-radius: 0 0 0.375rem 0.375rem;
}

/* Results list styling */
.result-item {
    border-left: 4px solid #0d6efd;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.result-item:hover {
    border-left-color: #0a58ca;
    background-color: #fff;
    transform: translateX(5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.distance-badge {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Form validation */
.was-validated .form-control:invalid {
    border-color: #dc3545;
}

.was-validated .form-control:valid {
    border-color: #198754;
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    #map {
        height: 300px !important;
    }
}

/* Navbar / offcanvas tweaks for mobile */
.navbar-brand {
    font-weight: 600;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
    outline: none;
}

.navbar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.offcanvas-body .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s;
}

.offcanvas-body .nav-link:hover,
.offcanvas-body .nav-link:focus {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.offcanvas-body .nav-link.active {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.offcanvas-body .nav-link i {
    margin-right: 0.75rem;
}

.offcanvas .dropdown-menu {
    position: static;
    float: none;
    border: none;
    box-shadow: none;
    padding-left: 1rem;
    margin-top: 0;
}

/* Candidates table small viewport tweaks */
@media (max-width: 576px) {
    #candidatesTable thead {
        display: none;
    }

    #candidatesTable,
    #candidatesTable tbody,
    #candidatesTable tr,
    #candidatesTable td {
        display: block;
        width: 100%;
    }

    #candidatesTable tr {
        margin-bottom: 0.75rem;
        border: 1px solid #e9ecef;
        padding: 0.5rem;
        border-radius: 0.375rem;
    }

    #candidatesTable td {
        padding: 0.25rem 0.5rem;
    }

    #candidatesTable td:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
    }
}

/* Sortable header visuals */
th.sortable {
    cursor: pointer;
}

th.sortable .sort-indicator {
    font-size: 0.8rem;
}

/* Animation for results */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

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

.

/* Availability Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e9ecef;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-day-header {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.25rem;
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background-color: #fff;
    min-height: 100px;
    padding: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    z-index: 2;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.day-num {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    display: block;
    color: #495057;
}

/* Status Styles */
.calendar-day.booked {
    background-color: #ffe5e5;
    border-left: 3px solid #dc3545;
}

.calendar-day.holiday {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.calendar-day.sick {
    background-color: #e2e3e5;
    border-left: 3px solid #6c757d;
}

.calendar-day.available {
    cursor: pointer;
}

.calendar-day.available:hover {
    background-color: #f0fff4;
    border-color: #198754;
}

.status-badge {
    display: block;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    font-weight: 500;
}

.status-badge.booked {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.status-badge.holiday {
    background-color: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.status-badge.available {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    opacity: 0;
}

.calendar-day:hover .status-badge.available {
    opacity: 1;
}

/* Mobile Calendar Adjustments */
@media (max-width: 768px) {
    .calendar-day-header {
        font-size: 0.7rem;
        padding: 0.5rem 0.1rem;
    }

    .calendar-day {
        min-height: 70px;
        /* Reduced height */
        padding: 0.25rem;
    }

    .day-num {
        font-size: 0.8rem;
    }

    .status-badge {
        font-size: 0.65rem;
        padding: 1px 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* On touch, always show available indicator if it's the only action */
    .status-badge.available {
        opacity: 0.7;
        /* Always visible on mobile */
        font-size: 0.6rem;
    }

    .status-badge.available i {
        display: none;
        /* Hide icon to save space */
    }
}