/* General Body and Font */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f0f0;
    color: #333; /* Default text color */
    transition: background-color 0.3s ease, color 0.3s ease; /* Added for dark mode transition */
    display: flex; /* Ensure body is a flex container for full height layout */
    flex-direction: column;
    min-height: 100vh;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #f0f0f0;
}

body.dark-mode .header {
    background: #333;
    box-shadow: 0 0 20px #555;
}

body.dark-mode .title {
    color: #f0f0f0;
}

body.dark-mode .welcome {
    color: #aaffaa; /* Lighter green for dark mode */
}

body.dark-mode .buttons button {
    background: #444;
    color: #f0f0f0;
}

body.dark-mode #logoutBtn.logout-btn {
    background: #882222;
}

body.dark-mode .buttons button:hover {
    background-color: #666;
}

body.dark-mode .link a {
    border: 2px solid #555;
    background: rgba(0, 255, 0, 0.05); /* Slightly darker green tint */
    color: #aaffaa;
}

body.dark-mode .link a:hover {
    transform: scale(1.05);
    background: rgba(0, 255, 0, 0.1);
}

body.dark-mode .social-section {
    background-color: #2a2a2a;
}

body.dark-mode .social-button {
    background-color: #3a3a3a;
    border: 1px solid #555;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: #f0f0f0;
}

body.dark-mode .social-button:hover {
    background-color: #4a4a4a;
}

/* Updated Dark Mode for Study Abroad Link */
body.dark-mode .study-abroad a {
    /* Darker green base for dark mode glow */
    box-shadow: 0 0 10px #004d00;
    border: 2px solid #004d00;
    color: #f0f0f0; /* Ensure text is visible */
    /* Dark mode specific white-black-white shine */
    background: linear-gradient(90deg,
        #003300 0%,      /* Dark green start */
        #003300 15%,     /* Dark green before first white */
        rgba(255,255,255,0.7) 20%, /* First white shine */
        #000000 25%,     /* Black band start */
        #000000 35%,     /* Black band end */
        rgba(255,255,255,0.7) 40%, /* Second white shine */
        #003300 45%,     /* Dark green after second white */
        #003300 100%     /* Dark green end */
    );
    background-size: 250% 100%; /* Wider gradient to allow full shine pattern to pass */
    animation: shinePatternDark 5s infinite linear; /* Use specific dark mode shine animation */
}

body.dark-mode .study-abroad a:hover {
    /* More intense glow for dark mode */
    box-shadow:
        0 0 15px #006600,
        0 0 30px #009900,
        0 0 40px #00cc00;
}

/* New Dark Mode Keyframes for Study Abroad Shine */
@keyframes shinePatternDark {
    0% { background-position: -150% 0; } /* Start shine off-screen left */
    100% { background-position: 150% 0; } /* End shine off-screen right */
}


body.dark-mode .footer-links a {
    color: #aaffaa;
}

body.dark-mode .chatbot-icon {
    background-color: #444;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    animation: pulse-glow-dark 2s infinite ease-in-out;
}

@keyframes pulse-glow-dark {
    0% {
        box-shadow: 0 0 0 0 rgba(70, 130, 180, 0.7); /* Steelblue for dark mode */
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 15px 10px rgba(70, 130, 180, 0);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(70, 130, 180, 0.7);
        transform: scale(1);
    }
}

body.dark-mode .chatbot-icon:hover {
    background-color: #666;
}

body.dark-mode .chatbot-window {
    background-color: #2a2a2a;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

body.dark-mode .chat-header {
    background-color: #444;
    color: #f0f0f0;
}

body.dark-mode .chat-messages {
    background-color: #222;
}

body.dark-mode .message {
    color: #f0f0f0;
}

body.dark-mode .user-message {
    background-color: #005500; /* Darker green for user messages */
}

body.dark-mode .bot-message {
    background-color: #3a3a3a;
}

body.dark-mode .chat-input-area {
    background-color: #2a2a2a;
    border-top: 1px solid #444;
}

body.dark-mode #chatInput {
    background-color: #3a3a3a;
    border: 1px solid #555;
    color: #f0f0f0;
}

body.dark-mode #chatInput::placeholder {
    color: #bbb;
}

body.dark-mode #sendMessageBtn {
    background-color: #007700;
}

body.dark-mode #sendMessageBtn:hover {
    background-color: #009900;
}

body.dark-mode .modal-content {
    background-color: #2a2a2a;
    color: #f0f0f0;
}

body.dark-mode .modal-header {
    background-color: #3a3a3a;
    border-bottom: 1px solid #555;
    color: #f0f0f0;
}

body.dark-mode .modal-title {
    color: #f0f0f0;
}

body.dark-mode .btn-close {
    filter: invert(1); /* Make close button visible in dark mode */
}

body.dark-mode .form-check-label {
    color: #f0f0f0;
}

body.dark-mode .modal-footer {
    border-top: 1px solid #555;
}

body.dark-mode .btn-secondary {
    background-color: #555;
    border-color: #555;
    color: #f0f0f0;
}

body.dark-mode .btn-outline-secondary {
    border-color: #666;
    color: #f0f0f0;
}

body.dark-mode .btn-outline-secondary:hover {
    background-color: #666;
    color: #f0f0f0;
}

body.dark-mode .message-avatar {
    border: 1px solid #666 !important;
}

body.dark-mode .message-sender-name {
    color: #aaffaa;
}

body.dark-mode .message-timestamp {
    color: #bbb;
}

body.dark-mode .chat-media-link {
    color: #aaffaa;
}

/* Dark mode for the featured media section */
body.dark-mode .featured-media-section {
    background-color: #2a2a2a;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

body.dark-mode .featured-media-section h3 {
    color: #aaffaa;
}

body.dark-mode #featuredMediaDisplay {
    background-color: #3a3a3a;
    color: #bbb;
}

body.dark-mode .media-title-overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .admin-media-list .list-group-item {
    background-color: #333;
    border-color: #555;
    color: #f0f0f0;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    background: limegreen;
    border-radius: 50px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 0 20px lime;
    position: relative;
}

.header-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    position: absolute;
    left: 20px;
}

.title {
    color: White;
    text-align: center;
}

/* Welcome Heading */
.welcome {
    text-align: center;
    color: darkgreen;
    margin-top: 30px;
}

.underline {
    border: none;
    height: 4px;
    background: linear-gradient(to right, red, yellow, green, cyan, blue, violet, black);
    margin: 0 auto 30px auto;
    width: 50%;
}

/* info section */
.info-section {
    display: flex;
    justify-content: space-between; /* To push left-aligned-controls left and buttons right */
    padding: 0 50px;
    align-items: center;
    margin-bottom: 30px;
}

/* NEW: Styles for the left-aligned icon group */
.left-aligned-controls {
    display: flex; /* Changed from none !important to flex for proper JS control */
    align-items: center;
    gap: 10px; /* Spacing between the icons */
    /* This element's display will be controlled by main.js based on login status */
}

/* --- MODIFIED: .buttons for better alignment and spacing using Flexbox --- */
.buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Ensure this container can grow to push loggedInControls to the right */
    flex-grow: 1;
    justify-content: flex-end; /* Align existing buttons to the right initially */
}

.buttons button {
    padding: 8px 16px;
    border: none;
    background: limegreen;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#logoutBtn.logout-btn {
    background: #dc3545;
}

.buttons button:hover {
    opacity: 0.9;
}

#navProfileImage {
    border: 1px solid #ccc;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Links grid */
.link {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 20px 50px;
}

.link a {
    display: block;
    text-align: center;
    padding: 20px;
    border: 2px solid green;
    border-radius: 10px;
    background: rgba(0, 255, 0, 0.1);
    text-decoration: none;
    color: darkgreen;
    font-weight: bold;
    transition: transform 0.3s;
}
.link a:hover {
    transform: scale(1.05);
}

/* --- NEW: Featured Media Section Styles --- */
.featured-media-section {
    margin: 50px auto;
    max-width: 900px; /* Set a fixed max-width for consistency */
    width: 90%; /* Responsive width */
    overflow: hidden;
    border-radius: 15px; /* More rounded corners */
    box-shadow: 0 8px 20px rgba(0,0,0,0.2); /* Stronger shadow */
    background-color: #fff;
    padding: 20px;
    text-align: center;
    position: relative; /* Added for media items positioning */
}

.featured-media-section h3 {
    color: darkgreen;
    margin-bottom: 20px;
    font-size: 1.8em;
}

#featuredMediaDisplay {
    position: relative;
    width: 600px; /* Fixed width for square aspect */
    height: 600px; /* Fixed height for square aspect */
    max-width: 100%; /* Ensure it doesn't overflow parent on smaller screens */
    max-height: 550px; /* Limit height on very tall screens if needed */
    margin: 0 auto; /* Center the display area */
    background-color: #e9ecef; /* Light background for empty state */
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #6c757d;
    font-style: italic;
    font-size: 1.1em;
}

/* Styles for dynamically loaded media items within featured media display */
#featuredMediaDisplay img,
#featuredMediaDisplay video,
#featuredMediaDisplay audio {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure media fits well */
    opacity: 0; /* Hidden by default */
    transition: opacity 1s ease-in-out; /* Smooth transition for media change */
}

#featuredMediaDisplay .featured-media-item.active {
    opacity: 1; /* Make active item visible */
}

.media-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-sizing: border-box; /* Include padding in width */
}

/* Styles for admin uploaded media list */
.admin-media-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.admin-media-list .list-group-item {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
}

.admin-media-list .img-thumbnail,
.admin-media-list video {
    border-radius: 5px;
    object-fit: cover;
}


/* Social icons container */
.social-section {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background-color: #f0f0f0;
}

.social-button {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.social-button:hover {
    background-color: #efefef;
}

.social-button img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    object-fit: contain;
}

.study-abroad {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.study-abroad a {
    display: inline-block;
    font-weight: bold;
    font-size: 1.2rem;
    color: white; /* Text color for the link */
    padding: 12px 30px;
    border-radius: 30px;
    /* Dark green base with a white-black-white shining effect */
    background: linear-gradient(90deg,
        #003300 0%,      /* Dark green start */
        #003300 15%,     /* Dark green before first white */
        rgba(255,255,255,0.7) 20%, /* First white shine */
        #000000 25%,     /* Black band start */
        #000000 35%,     /* Black band end */
        rgba(255,255,255,0.7) 40%, /* Second white shine */
        #003300 45%,     /* Dark green after second white */
        #003300 100%     /* Dark green end */
    );
    background-size: 250% 100%; /* Make the gradient wider than the element */
    animation: shinePattern 5s infinite linear; /* Animation for the shine effect */
    box-shadow: 0 0 10px #006600; /* Darker green glow */
    text-decoration: none;
    border: 2px solid #006600; /* Darker green border */
    transition: box-shadow 0.3s ease;
}

.study-abroad a:hover {
    box-shadow:
        0 0 15px #008000,
        0 0 30px #00AA00,
        0 0 40px #00DD00;
    color: white;
}

/* Keyframes for the white-black-white shining effect */
@keyframes shinePattern {
    0% { background-position: -150% 0; } /* Start shine off-screen left */
    100% { background-position: 150% 0; } /* End shine off-screen right */
}

/* Footer Links */
.footer-links {
    text-align: center;
    margin: 30px 0;
}

.footer-links a {
    margin: 0 10px;
    color: green;
    text-decoration: none;
    font-weight: bold;
}

/* --- NEW/MODIFIED CHATBOT ICON AND WINDOW STYLES --- */
.chatbot-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: limegreen;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999; /* Ensure it's below the window when open */
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 3px solid transparent;
    animation: pulse-glow 2s infinite ease-in-out;
}

.chatbot-icon:hover {
    background-color: #5cb85c;
    transform: scale(1.05);
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 252, 0, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 15px 10px rgba(124, 252, 0, 0);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(124, 252, 0, 0.7);
        transform: scale(1);
    }
}

/* Chatbot Window Styles (Updated for initial hidden state and smoother animation) */
.chatbot-window {
    position: fixed;
    bottom: 90px; /* Above the chatbot icon */
    right: 20px;
    width: 320px;
    height: 400px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 1001; /* Higher than icon */
    overflow: hidden;
    /* Initial state: scaled down, invisible, unclickable */
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-out; /* Smooth transition for opening/closing */
}

.chatbot-window.open {
    /* Final state when open */
    transform: scale(1);
    opacity: 1;
    pointer-events: all; /* Make it clickable when open */
}

.chat-header {
    background-color: limegreen;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chat-header h3 {
    margin: 0;
}

#closeChatBtn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.message {
    padding: 8px 12px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 80%;
    word-wrap: break-word;
    display: flex; /* Use flex for avatar and content */
    align-items: flex-start; /* Align items to the top */
}

.user-message {
    background-color: #e6ffe6;
    color: #333;
    align-self: flex-end;
    margin-left: auto;
    flex-direction: row-reverse; /* Reverse order for user messages */
}

.bot-message {
    background-color: #f0f0f0;
    color: #333;
    align-self: flex-start;
    margin-right: auto;
}

/* Community Chat Specific Styles */
.modal-body {
    position: relative; /* For emoji picker positioning */
}

.chat-input-area.d-flex { /* Targeting the community chat input area */
    border-top: 1px solid #eee;
    padding: 10px;
    background-color: #fff;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.media-upload-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    padding: 0;
    flex-shrink: 0; /* Prevent shrinking */
}

#communityChatInput {
    flex-grow: 1;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.95em;
    outline: none;
}

#sendCommunityMessageBtn {
    background-color: limegreen;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

#sendCommunityMessageBtn:hover {
    background-color: darkgreen;
}

/* Chat Message Content Styling */
.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px; /* Space between avatar and message content */
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.user-message .message-avatar {
    margin-right: 0;
    margin-left: 10px; /* For user messages, avatar on the right */
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 40px); /* Adjust max-width to account for avatar */
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8em;
    margin-bottom: 3px;
    width: 100%;
}

.user-message .message-header {
    flex-direction: row-reverse; /* Reverse for user messages header */
}

.message-sender-name {
    font-weight: bold;
    color: #4CAF50; /* Green for sender name */
}

.message-timestamp {
    color: #888;
    margin-left: 5px;
}

.user-message .message-timestamp {
    margin-left: 0;
    margin-right: 5px;
}

.message-text {
    background-color: inherit; /* Inherit from parent message bubble */
    padding: 8px 12px;
    border-radius: 15px;
    word-wrap: break-word;
    max-width: 100%; /* Ensure text wraps within content area */
}

/* Styling for media within chat messages */
.chat-image,
.chat-video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 5px;
    display: block;
}

.chat-audio {
    width: 100%;
    margin-top: 5px;
}

.chat-media-link {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    color: #007bff; /* Bootstrap primary blue */
    text-decoration: none;
}

.chat-media-link:hover {
    text-decoration: underline;
}

/* Emoji Picker Container */
#emojiPickerContainer {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden; /* Ensure picker content stays within bounds */
}

emoji-picker {
    --emoji-size: 24px;
    --num-columns: 8;
    --background: #fff;
    --border-color: #ddd;
    --button-hover-background: #eee;
    --category-label-background: #f9f9f9;
    --text-color: #333;
    --font-family: 'Arial', sans-serif;
    --indicator-color: limegreen;
    --outline-color: limegreen;
    --search-background: #f0f0f0;
    --search-border-color: #ccc;
    --search-text-color: #333;
    --search-placeholder-color: #888;
    --secondary-text-color: #666;
    height: 300px; /* Adjust height as needed */
    width: 300px; /* Adjust width as needed */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body.dark-mode emoji-picker {
    --background: #333;
    --border-color: #555;
    --button-hover-background: #444;
    --category-label-background: #2a2a2a;
    --text-color: #f0f0f0;
    --indicator-color: #aaffaa;
    --outline-color: #aaffaa;
    --search-background: #444;
    --search-border-color: #666;
    --search-text-color: #f0f0f0;
    --search-placeholder-color: #bbb;
    --secondary-text-color: #ccc;
}

/* NEW: Green theme for specific icon buttons - matched to Register/Login style */
.icon-btn.settings-icon-green,
.icon-btn.chat-icon-green,
.icon-btn.community-hub-icon-green {
    background-color: limegreen !important; /* Green background */
    color: white !important; /* White text/icon */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none; /* Ensure no default button border */
    padding: 8px 16px; /* Matched to Register/Login buttons */
    border-radius: 5px; /* Matched to Register/Login buttons */
    font-size: 1rem; /* Matched to Register/Login buttons */
    display: flex; /* Enable flex for icon and text */
    align-items: center;
    gap: 5px; /* Space between icon and text */
}

.icon-btn.settings-icon-green:hover,
.icon-btn.chat-icon-green:hover,
.icon-btn.community-hub-icon-green:hover {
    background-color: darkgreen !important; /* Darker green on hover */
    transform: translateY(-1px);
}

/* NEW: Profile Modal Styles (Yellow Themed) */
.profile-modal-content {
    background-color: #fffbeb; /* Light yellow background */
}

.profile-modal-header {
    background-color: #FACC15; /* Yellow header */
    color: white;
    border-bottom: 1px solid #EAB308;
}

.profile-modal-content .btn-warning { /* For upload photo button */
    background-color: #FACC15;
    border-color: #FACC15;
}
.profile-modal-content .btn-warning:hover {
    background-color: #EAB308;
    border-color: #EAB308;
}
.profile-modal-content #profile-picture {
    border-color: #FACC15; /* Yellow border for profile picture */
}

/* NEW: Settings Modal Styles (Green Themed to match original design) */
.settings-modal-content {
    background-color: #f9f9f9; /* Light background for settings */
}

.settings-modal-header {
    background-color: limegreen; /* Green header for settings */
    color: white;
    border-bottom: 1px solid darkgreen;
}

/* NEW: Chat Modal Styles (Green Themed to match original design) */
.chat-modal-content {
    background-color: #f9f9f9; /* Light background for chat */
}

.chat-modal-header {
    background-color: limegreen; /* Green header for chat */
    color: white;
    border-bottom: 1px solid darkgreen;
}


/* NEW: Community Hub Modal Specific Styles (Green Theme) */
.community-hub-modal-content {
    background-color: #e6ffe6; /* Light green background */
}

.community-hub-modal-header {
    background-color: limegreen; /* Green header */
    color: white;
    border-bottom: 1px solid darkgreen;
}

/* Video chat specific styles (within the modal) */
.video-chat-container {
    background-color: #e6ffe6; /* Light green background for the video section */
    border: 1px solid #aaffaa; /* Light green border */
    display: flex; /* Use flexbox for internal layout */
    flex-direction: column; /* Stack elements vertically */
}

.video-chat-container .flex-grow-1 {
    flex-grow: 1; /* Allow video elements to take available space */
    display: flex;
    flex-direction: column; /* Stack videos on mobile */
}

@media (min-width: 768px) {
    .video-chat-container .flex-grow-1 {
        flex-direction: row; /* Side-by-side videos on desktop */
    }
}

video {
    background-color: #d0d0d0; /* Placeholder background for video streams */
    border-radius: 8px;
    object-fit: cover; /* Ensures video fills the container */
    width: 100%;
    height: 100%; /* Take full height of parent flex item */
}

/* Ensure buttons have consistent styling and spacing */
.video-chat-container button {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
    color: white; /* Ensure text is white for all buttons here */
}

.video-chat-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Specific button colors for video chat controls (Green themed) */
#webcamButton { background-color: limegreen; border-color: limegreen; }
#webcamButton:hover { background-color: darkgreen; border-color: darkgreen; }

#createCallButton { background-color: #4CAF50; border-color: #4CAF50; } /* A shade of green */
#createCallButton:hover { background-color: #388E3C; border-color: #388E3C; }

#joinCallButton { background-color: #66BB6A; border-color: #66BB6A; } /* A lighter, vibrant green */
#joinCallButton:hover { background-color: #43A047; border-color: #43A047; }

#hangupButton { background-color: #EF4444; border-color: #EF4444; } /* Red for hangup */
#hangupButton:hover { background-color: #DC2626; border-color: #DC2626; }

#meetingIdInput {
    border-color: limegreen; /* Green border for input */
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.075);
}
#meetingIdInput:focus {
    border-color: darkgreen;
    box-shadow: 0 0 0 0.25rem rgba(0, 128, 0, 0.25); /* Green focus ring */
}

/* Scheduled Meetings List */
#upcoming-meetings-list .list-group-item {
    background-color: #f0fff0; /* Very light green for list items */
    border-color: #c8e6c9;
}

#upcoming-meetings-list .list-group-item strong {
    color: #388E3C; /* Darker green text for meeting name */
}

#upcoming-meetings-list .list-group-item .text-sm {
    color: #66BB6A; /* Medium green for IDs */
}

#upcoming-meetings-list .list-group-item .text-xs {
    color: #81C784; /* Lighter green for timestamps */
}

/* Join button in list */
.join-listed-meeting-btn {
    background-color: limegreen !important; /* Green join button */
    border-color: limegreen !important;
    color: white !important;
}

.join-listed-meeting-btn:hover {
    background-color: darkgreen !important;
    border-color: darkgreen !important;
}

/* NEW: Chatbot Input Field Styling (Yellow Rounded) */
.chatbot-window #chatInput {
    background-color: #FFFACD; /* Light yellow */
    border: 1px solid #FFD700; /* Gold border */
    border-radius: 25px; /* Fully rounded */
    padding: 10px 15px;
    font-size: 1em;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.chatbot-window #chatInput::placeholder {
    color: #8B8B00; /* Darker yellow placeholder */
}

.chatbot-window #chatInput:focus {
    outline: none;
    border-color: #FFA500; /* Orange on focus */
    box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.25); /* Yellow glow on focus */
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        min-height: auto; /* Allow content to dictate height on smaller screens */
    }
    .header {
        margin: 10px;
        padding: 15px;
    }
    .header-img {
        width: 50px;
        height: 50px;
        left: 10px;
    }
    .title {
        font-size: 1.5em;
    }
    .welcome {
        margin-top: 20px;
        font-size: 1.2em;
    }
    .underline {
        width: 80%; /* Adjust for smaller screens */
    }
    .info-section {
        flex-direction: column; /* Stack settings icon and buttons vertically */
        padding: 0 20px;
        align-items: flex-start; /* Align settings icon to left */
    }
    .left-aligned-controls {
        width: 100%; /* Full width for the left group on mobile */
        justify-content: center; /* Center the icons within the left group */
        margin-bottom: 10px; /* Space below it */
    }
    .buttons {
        flex-direction: row; /* Keep buttons in a row for small screens */
        flex-wrap: wrap;
        justify-content: center;
        width: 100%; /* Take full width */
    }
    .buttons button {
        width: auto; /* Adjust width automatically */
        flex-grow: 1; /* Allow buttons to grow */
        margin: 5px; /* Add some margin */
    }
    #loggedInControls {
        flex-wrap: wrap;
        justify-content: center;
    }
    #welcomeMessageContainer {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    .link {
        grid-template-columns: repeat(2, 1fr);
        padding: 10px 20px;
    }
    .link a {
        padding: 15px;
        font-size: 0.9em;
    }
    .featured-media-section {
        max-width: 95%; /* Adjust for smaller screens */
        padding: 15px;
    }
    #featuredMediaDisplay {
        min-height: 250px; /* Adjust height for smaller screens */
        width: 100%; /* Make it responsive width on smaller screens */
        height: auto; /* Allow height to adjust based on content/aspect ratio */
        aspect-ratio: 1 / 1; /* Maintain square aspect ratio on smaller screens */
    }
    .social-section {
        flex-wrap: wrap;
        padding: 10px;
    }
    .social-button {
        flex-grow: 1;
        margin: 5px;
    }
    .study-abroad a {
        font-size: 1em;
        padding: 10px 20px;
    }
    .chatbot-window {
        width: 90%;
        right: 5%;
        bottom: 80px;
        height: 70vh; /* Make it taller on mobile */
    }
    .chat-input-area.d-flex {
        flex-wrap: wrap; /* Allow buttons to wrap */
        justify-content: center;
    }
    .media-upload-btn, #emojiPickerBtn {
        margin-bottom: 5px;
    }
    #communityChatInput {
        width: 100%;
        margin-right: 0;
        margin-top: 5px;
    }
    #sendCommunityMessageBtn {
        margin-top: 5px;
    }
    #emojiPickerContainer {
        width: 90%; /* Adjust width for mobile */
        right: 5%;
        bottom: 120px; /* Adjust position relative to new input area */
    }
    .modal-dialog {
        margin: 0.5rem; /* Reduce margin for modals */
    }
    .modal-body {
        height: auto !important; /* Allow modal body to adjust height */
    }
    .video-chat-container .flex-grow-1 > video {
        height: 180px; /* Adjust video height for mobile */
    }
}

@media (max-width: 480px) {
    .link {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    .header {
        flex-direction: column;
        text-align: center;
    }
    .header-img {
        position: static;
        margin-bottom: 10px;
    }
    .info-section {
        padding: 0 10px;
    }
    .buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .buttons button {
        width: 100%;
        margin: 5px 0;
    }
    .social-section {
        flex-direction: column;
        align-items: center;
    }
    .social-button {
        width: 90%;
        margin: 5px 0;
    }
    .study-abroad a {
        font-size: 0.9em;
        padding: 8px 15px;
    }
    .chatbot-window {
        height: 80vh; /* Maximize height on smallest screens */
        bottom: 10px;
        right: 10px;
    }
    .chatbot-icon {
        bottom: 10px;
        right: 10px;
    }
}
