:root {
    /* Define a new variable that will default to 100vh */
    --app-height: 100vh;
}

    .mobile-nav {
        display: none;
    }

.main-container, .chat-container {
    height: var(--app-height); /* Use the variable */
}

/* Make sure the sidebar also uses this variable on mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; /* Make sidebar an overlay */
        left: 0;
        top: 0;
        width: 260px; /* Give it a fixed width */
        z-index: 3000; /* Ensure it's on top of everything */
        transform: translateX(-100%); /* Hide it off-screen to the left */
        transition: transform 0.3s ease-in-out;
        border-right: 1px solid #EAEAEA;
    }
    
    .chat-sidebar, .chat-window {
        height: var(--app-height);
    }
		  	.sidebar {
        height: var(--app-height);
    }
h1 {
	margin:auto;
	font-size:1.8rem;
	}
.fc .fc-toolbar {
	display:block;
	margin-left:auto;
	margin-right:auto;
	}

/* --- Mobile Overhaul --- */
@media (max-width: 768px) {

    /* 1. Hide Desktop Navigation */
    .sidebar, #menu-toggle {
        display: none !important;
    }
    
    /* 2. Adjust Main Content for Bottom Nav */
    .main-container {
        flex-direction: column;
    }
    .main-content {
        padding-bottom: 90px; /* Add padding to prevent content from being hidden by the nav bar */
    }

    /* 3. The New Bottom Navigation Bar */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--sidebar-bg);
        box-shadow: 0 -2px 15px var(--shadow-color);
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        padding: 8px 0;
    }
    
    .mobile-nav .nav-link {
        flex-grow: 1;
		position: relative; /* This is necessary for positioning the badge inside it */
        text-align: center;
        text-decoration: none;
        color: var(--text-color-body);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        gap: 4px;
        transition: color 0.2s ease;
    }

    .mobile-nav .nav-link i {
        font-size: 18px;
    }

    /* Active State for Bottom Nav */
    .mobile-nav .nav-link.active {
        color: var(--primary-accent);
    }
    
    .chat-container {
        position: relative;
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    .chat-sidebar {
        width: 100%;
        position: absolute;
        height: 100%;
        transform: translateX(0);
        transition: transform 0.3s ease-in-out;
        z-index: 100;
    }
    

    /* State when a chat is active */
    .chat-container.chat-active .chat-sidebar {
        transform: translateX(-100%); /* Slide user list out */
    }
    .chat-container.chat-active .chat-window {
        transform: translateX(0); /* Slide chat window in */
    }

    /* Back button for chat window */
    .chat-header .back-btn {
        display: inline-block; /* Show the back button */
        margin-right: 15px;
        cursor: pointer;
    }
								
	    /* --- 3. Adjustments for Smaller Screens --- */
    .post-card, .profile-container, .modal-content {
        padding: 15px;
    }
    
    .dashboard-header h1 {
        font-size: 24px;
    }

    #createPostBtn { /* Floating action button */
        bottom: 20px;
        right: 15px;
    }
  
      .chat-container {
        position: relative;
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    .chat-sidebar {
        width: 100%;
        position: absolute;
        height: 100%;
        transform: translateX(0);
        transition: transform 0.3s ease-in-out;
        z-index: 100;
    }
    
    .chat-window {
        width: 100%;
        position: absolute;
        height: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 200;
    }
  
  .chat-input-form {
  		padding:auto;
  }

    /* State when a chat is active */
    .chat-container.chat-active .chat-sidebar {
        transform: translateX(-100%); /* Slide user list out */
    }
    .chat-container.chat-active .chat-window {
        transform: translateX(0); /* Slide chat window in */
    }

    /* Back button for chat window */
    .chat-header .back-btn {
        display: inline-block !important; /* Show the back button */
        margin-right: 15px;
        cursor: pointer;
    }
				  
	.fc .fc-toolbar {
		display:grid;
	}

			
  .mobile-nav .nav-badge {
	  position: absolute; /* Position it relative to the nav-link */
	  top: 2px;
	  right: 15px; /* Adjust as needed to position over the icon */
	  background-color: #FF6B6B;
	  color: white;
	  font-size: 10px;
	  font-weight: 600;
	  padding: 2px 6px;
	  border-radius: 10px;
	  line-height: 1;
	  display: none; /* Hidden by default */
	  border: 2px solid var(--sidebar-bg); /* Creates a nice cutout effect */
  }  
}