/* Apply border-box for consistent box model */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Ensure html and body take full width and prevent horizontal overflow */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5; /* Light gray background */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* New Header Styling */
.top-nav {
    background-color: #d1fae5; /* Light green background for the top navigation */
    color: #065f46; /* Dark green text color */
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow */
    z-index: 50;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Space between logo and app name */
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Circular logo */
    object-fit: cover;
    /* Add a subtle border to the logo to match the image */
    border: 2px solid #34d399; /* Green border */
}

.app-name {
    font-size: 1.25rem; /* Larger font for app name */
    font-weight: 700; /* Bold */
    color: #065f46; /* Dark green color */
    text-decoration: none;
    transition: color 0.2s;
}

.app-name:hover {
    color: #10b981; /* Slightly darker green on hover */
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between icons */
}

/* Existing Profile Icon and Dropdown Styling (adjusted for new header colors) */
.profile-dropdown-container {
    position: relative; /* For positioning the dropdown menu */
}

.profile-icon {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: #34d399; /* Green background for profile icon */
    color: #ffffff; /* White text */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
.profile-icon:hover {
    background-color: #10b981; /* Darker green on hover */
}

.dropdown-menu {
    position: absolute;
    top: 50px; /* Position below the profile icon */
    right: 0; /* Align to the right of the profile icon */
    background-color: #ffffff; /* White background for dropdown */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 100;
    min-width: 180px;
}
.dropdown-menu a.dropdown-item { /* Specificity for dropdown items */
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #333333; /* Dark text for items */
    text-decoration: none;
    transition: background-color 0.2s;
}
.dropdown-menu a.dropdown-item:hover {
    background-color: #f0f2f5; /* Light gray on hover */
}
.dropdown-menu a.dropdown-item .icon {
    margin-right: 0.75rem; /* Space between icon and text */
    font-size: 1rem;
    color: #6b7280; /* Gray color for icons in dropdown */
}

/* General Icon Button Styling (for other header icons like message/notification) */
.icon-button {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: #34d399; /* Green background for other icons */
    color: #ffffff; /* White icon color */
    cursor: pointer;
    transition: background-color 0.2s;
}
.icon-button:hover {
    background-color: #10b981; /* Darker green on hover */
}


/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow: hidden; /* Prevent main content from overflowing */
    flex-wrap: wrap; /* Allow items to wrap to the next line on smaller screens */
}
.inbox-list, .chat-window {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* For scrolling content */
}
.inbox-list {
    flex: 1; /* Allow to grow and shrink equally relative to others */
    min-width: 280px; /* Minimum width for the inbox list on larger screens */
    max-width: 350px;
    min-width: 0; /* Crucial: allow shrinking to 0 if needed */
}
.chat-window {
    flex: 2; /* Allow to grow and shrink, taking twice the space of inbox-list */
    min-width: 300px; /* Minimum width for the chat window on larger screens */
    min-width: 0; /* Crucial: allow shrinking to 0 if needed */
}
.inbox-header {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
}
.chat-header {
    background-color: #d1fae5; /* green-100 */
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #bbf7d0; /* green-200 */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.chat-header .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #065f46; /* green-800 */
}
.chat-header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0f2fe;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: #1e40af;
}
.chat-messages {
    flex-grow: 1; /* Allows messages area to take all available vertical space */
    padding: 1.5rem;
    overflow-y: auto; /* Enable vertical scrolling for messages */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 200px; /* Ensure a minimum height for the message area */
}
.message-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word; /* Ensure long words break and wrap */
    overflow-wrap: break-word; /* Modern property for word wrapping */
}
.message-bubble.sent {
    background-color: #d1fae5; /* green-100 */
    color: #065f46; /* green-800 */
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message-bubble.received {
    background-color: #e0f2fe; /* blue-50 */
    color: #1e40af; /* blue-800 */
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.message-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.message-input-area input[type="text"] {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.message-input-area input[type="text"]:focus {
    border-color: #93c5fd; /* blue-300 */
}
.message-input-area .send-button {
    background-color: #34d399; /* green-500 */
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}
.message-input-area .send-button:hover {
    background-color: #10b981; /* green-600 */
}
.message-input-area .icon-button {
    background-color: #f0f2f5; /* Light gray */
    color: #6b7280; /* Gray-500 */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.message-input-area .icon-button:hover {
    background-color: #e5e7eb; /* Gray-200 */
    color: #374151; /* Gray-700 */
}
/*messsa upload*/
.image-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* default hidden */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.image-upload-modal:not(.hidden) {
    display: flex; /* show kapag tinanggal yung hidden */
}

.image-upload-modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
}
.image-upload-modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.image-upload-modal-content button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}
.image-upload-modal-content .send-image-button {
    background-color: #34d399; /* green-500 */
    color: #fff;
    margin-right: 1rem;
}
.image-upload-modal-content .send-image-button:hover {
    background-color: #10b981; /* green-600 */
}
.image-upload-modal-content .cancel-image-button {
    background-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
}
.image-upload-modal-content .cancel-image-button:hover {
    background-color: #d1d5db; /* gray-300 */
}

/* Responsive adjustments */
/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column; /* Stack items vertically */
        padding: 1rem;
        gap: 1rem;
        height: calc(100vh - 80px); /* para mag-fill screen */
    }

    .inbox-list {
        flex: none;
        width: 100%;
        max-height: 40vh; /* instead of fixed 250px */
        overflow-y: auto; /* allow scrolling if marami messages */
        min-width: unset;
        max-width: unset;
    }

    .chat-window {
        flex: none;
        width: 100%;
        height: 60vh; /* chat takes remaining space */
        min-width: unset;
        display: flex;
        flex-direction: column;
    }

    .chat-messages {
        flex: 1; /* expand to fill */
        overflow-y: auto;
        min-height: 150px;
    }

    .chat-window {
        display: none; /* hide chat by default on mobile */
        width: 100%;
        height: 100%;
    }

    .chat-window.active {
        display: flex; /* show when active */
        flex-direction: column;
    }

    #backToInbox {
        display: inline-flex !important; /* show back button on mobile */
    }

}

/* Ensure the chat window fills available height properly */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Make sure messages area actually scrolls */
.chat-messages {
    flex: 1; /* Fill available space */
    overflow-y: auto; /* Enable vertical scroll */
    scroll-behavior: smooth; /* Smooth scrolling */
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Optional: add a soft fade at the top to hint at scrollable area */
.chat-messages::before {
    content: "";
    position: sticky;
    top: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), transparent);
    pointer-events: none;
}


/* Modal overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

/* Modal content */
.modal-content {
    position: relative;
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}



/* Modal content */
.modal-content {
    position: relative; /* para gumana yung absolute ng close button */
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Close button (X) */
.modal-content .close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;  /* malaki */
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-content .close:hover {
    color: #000;
}

/* Modal title */
.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Stars */
.stars {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.star {
    font-size: 40px; /* make it bigger */
    color: #ccc;     /* default gray */
    cursor: pointer;
    transition: color 0.2s;
}

.star.selected,
.star:hover,
.star:hover ~ .star {
    color: gold;     /* highlight gold */
}

/* Submit button */
#submitRating {
    background-color: #34d399; /* Green-500 */
    color: #fff;
    border: none;
    padding: 10px 25px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#submitRating:hover {
    background-color: #059669; /* darker green */
}

