/* Custom CSS for Hospital App */

/* General Body Styling */
html, body { /* Make html and body take full height */
    height: 100%;
}

body {
    font-family: 'Quicksand', sans-serif; /* Changed to Quicksand */
    background-color: #f8f9fa; /* Light gray background */
    color: #343a40; /* Dark gray text */
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack children vertically */
}

/* Navbar (Header) Styling with Gradient */
.navbar {
    background: linear-gradient(to right, #0a1128, #001f54); /* Dark blue to medium blue gradient */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Stronger shadow for depth */
    transition: all 0.3s ease-in-out; /* Smooth transition for any changes */
}

.navbar-brand {
    font-weight: 700; /* Bold font for brand */
    transition: transform 0.2s ease-in-out;
}

.navbar-brand:hover {
    transform: scale(1.05); /* Slight scale on hover */
}

.navbar-nav .nav-link {
    color: #e0e0e0 !important; /* Lighter text color for nav links */
    font-weight: 500;
    transition: color 0.3s ease-in-out, transform 0.2s ease-in-out;
    border-radius: 50px; /* Rounded pill shape for hover effect */
    padding: 8px 15px;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important; /* White on hover */
    transform: translateY(-2px); /* Slight lift on hover */
    background-color: rgba(255, 255, 255, 0.1); /* Subtle background on hover */
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2); /* Highlight active link */
}

/* Dropdown menus within navbar */
.navbar-nav .dropdown-menu {
    background: linear-gradient(to bottom, #001f54, #0a1128); /* Dark gradient for dropdown */
    border: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-radius: 0.75rem;
}

.navbar-nav .dropdown-item {
    color: #e0e0e0 !important;
    padding: 10px 15px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.navbar-nav .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

.navbar-nav .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.1);
}


/* Buttons Styling */
.btn {
    border-radius: 50px; /* Make all buttons rounded pills */
    font-weight: 500;
    transition: all 0.3s ease-in-out; /* Smooth transitions */
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px); /* Lift effect */
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4);
}

.btn-outline-light {
    border-width: 2px;
    transition: all 0.3s ease-in-out;
}
.btn-outline-light:hover {
    background-color: #f8f9fa;
    color: #007bff !important;
    transform: scale(1.02);
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 193, 7, 0.4);
}

/* Form Controls Styling */
.form-control, .form-select {
    border-radius: 15px; /* Slightly rounded corners for inputs */
    padding: 10px 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* Card Styling */
.card {
    border: none;
    border-radius: 1rem; /* More rounded cards */
    overflow: hidden; /* Ensures content stays within rounded corners */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* Deeper shadow */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* New: Hover effect for cards */
.hover-lift:hover {
    transform: translateY(-8px); /* More pronounced lift */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); /* Stronger shadow */
}

.card-header {
    border-bottom: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-header.bg-primary {
    background-color: #007bff !important;
    background: linear-gradient(to right, #007bff, #0056b3) !important; /* Gradient for primary header */
}
.card-header.bg-success {
    background-color: #28a745 !important;
    background: linear-gradient(to right, #28a745, #218838) !important; /* Gradient for success header */
}
.card-header.bg-info {
    background-color: #17a2b8 !important;
    background: linear-gradient(to right, #17a2b8, #138496) !important; /* Gradient for info header */
}
.card-header.bg-warning {
    background-color: #ffc107 !important;
    background: linear-gradient(to right, #ffc107, #e0a800) !important; /* Gradient for warning header */
    color: #212529 !important; /* Dark text for warning background */
}
.card-header.bg-danger {
    background-color: #dc3545 !important;
    background: linear-gradient(to right, #dc3545, #c82333) !important; /* Gradient for danger header */
}
.card-header h5 {
    color: #fff;
}


/* List Group Styling */
.list-group-item {
    border-radius: 0.75rem; /* Rounded corners for list items */
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease-in-out;
}

.list-group-item:hover {
    background-color: #f1f3f5; /* Light highlight on hover */
    transform: translateX(3px); /* Slight slide effect */
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 50px;
    font-weight: 600;
}

/* Table Styling */
.table {
    border-radius: 0.75rem;
    overflow: hidden; /* Ensures rounded corners on table container */
}
.table thead th {
    background-color: #007bff;
    color: white;
    border-bottom: none;
    padding: 1rem;
}
.table tbody tr:hover {
    background-color: #e9f5ff; /* Light blue hover for table rows */
}

/* Chat Messages Styling */
.chat-container {
    height: 60vh; /* Use viewport height for chat scroll area */
    min-height: 400px; /* Minimum height for chat */
    display: flex;
    flex-direction: column;
}

.chat-messages-body {
    flex-grow: 1; /* Allows message body to expand */
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 15px;
    background-color: #f0f2f5; /* Light background for chat area */
    border-radius: 0.75rem;
}

.message-bubble {
    padding: 12px 18px; /* Slightly larger padding */
    border-radius: 25px; /* More rounded */
    margin-bottom: 12px; /* Increased margin */
    max-width: 80%; /* Adjusted max width */
    word-wrap: break-word; /* Ensures long words wrap */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15); /* Stronger shadow */
    position: relative; /* For timestamp absolute positioning */
}

.message-bubble.sent {
    background-color: #007bff; /* Primary blue for sent messages */
    color: white;
    margin-left: auto; /* Align to right */
    border-bottom-right-radius: 8px; /* Slightly sharper bottom right */
}

.message-bubble.received {
    background-color: #e2e6ea; /* Light gray for received messages */
    color: #343a40;
    margin-right: auto; /* Align to left */
    border-bottom-left-radius: 8px; /* Slightly sharper bottom left */
}

.message-bubble .sender-name {
    font-size: 0.85em; /* Slightly larger font */
    font-weight: bold;
    margin-bottom: 5px; /* Increased margin */
    color: rgba(255, 255, 255, 0.8); /* Lighter color for sender name in sent messages */
}

.message-bubble.received .sender-name {
    color: #5a6268; /* Darker color for sender name in received messages */
}

.message-bubble .message-text {
    font-size: 1em;
    line-height: 1.4;
}

.message-bubble .timestamp {
    font-size: 0.75em; /* Slightly larger timestamp */
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
    text-align: right;
    display: block; /* Ensure it takes full width for alignment */
}

.message-bubble.received .timestamp {
    color: #6c757d;
    text-align: left;
}


/* Footer specific styles */
footer {
    background-color: #0a1128; /* Match header dark blue */
    color: #e0e0e0;
    padding: 2rem 0; /* Adjust padding */
    font-size: 0.85rem;
}

footer a {
    color: #e0e0e0; /* Link color in footer */
    transition: color 0.2s ease-in-out;
}

footer a:hover {
    color: #007bff; /* Primary blue on hover */
}

/* Responsive Adjustments for Navbar */
@media (max-width: 991.98px) { /* Adjust from md to lg for more aggressive collapse if needed, or keep md for consistency */
    .navbar-expand-md .navbar-collapse {
        flex-direction: column; /* Stack items vertically when collapsed */
        align-items: flex-start; /* Align items to the left */
    }
    .navbar-nav .nav-link {
        padding: 8px 10px; /* Adjust padding for stacked links */
        text-align: left; /* Align text to left */
        width: 100%; /* Make links take full width of collapse menu */
        border-radius: 0; /* Remove rounded pill for stacked items */
    }
    .navbar-nav .nav-item {
        width: 100%; /* Each nav item takes full width */
    }
    /* Ensure dropdowns take full width when collapsed */
    .navbar-nav .dropdown-menu {
        width: 100%;
        text-align: left; /* Align dropdown items to left */
    }
    .navbar-nav .dropdown-item {
        padding: 8px 15px;
    }

    /* Compact user dropdown specific adjustments for smaller screens */
    .compact-user-dropdown .nav-item.dropdown .nav-link {
        padding-right: 0 !important; /* Reduce right padding on dropdown toggle */
    }
    .compact-user-dropdown .nav-item .btn {
        width: 100%; /* Make login/register buttons take full width */
        margin-right: 0 !important; /* Remove right margin */
        margin-bottom: 8px; /* Add bottom margin for stacked buttons */
    }
}

/* Additional specific adjustments for screens smaller than ~992px (Bootstrap's lg) */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        font-size: 0.95rem; /* Slightly reduce font size for better fit */
    }
    /* Hide the "(Role)" text for the user dropdown on screens smaller than large */
    .navbar-nav .dropdown-toggle .d-lg-inline {
        display: none !important;
    }
}


/* Adjustments for extra small screens if needed (e.g., very old/small devices) */
@media (max-width: 575.98px) { /* For screens smaller than Bootstrap's 'sm' breakpoint */
    .navbar-brand {
        font-size: 1.1rem;
    }
    .navbar-nav .nav-link {
        font-size: 0.9rem;
    }
    .btn-lg { /* Reduce size of large buttons on very small screens */
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    .message-bubble {
        max-width: 95%; /* Make chat bubbles wider on very small screens */
    }
}
