/* Base styles for both modes */
:root {
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --accent-color: #047857;
    --accent-hover: #064e3b;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --dropdown-bg: #ffffff;
    --hover-bg: #d1fae5;
    --success-bg: #10b981;
    --info-bg: #3b82f6;
    --warning-bg: #f59e0b;
    --danger-bg: #ef4444;
}

/* Dark mode colors */
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e5e5e5;
    --text-secondary: #9ca3af;
    --border-color: #404040;
    --accent-color: #10b981;
    --accent-hover: #059669;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --dropdown-bg: #2d2d2d;
    --hover-bg: #404040;
    --success-bg: #065f46;
    --info-bg: #0c4a6e;
    --warning-bg: #854d0e;
    --danger-bg: #7f1d1d;
}

/* Navbar styles */
.navbar {
    background-color: var(--bg-primary) !important;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.navbar-brand img {
    height: 40px;
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    margin-right: 10px;
    font-weight: 500;
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    width: calc(100% - 2rem);
    height: 2px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color) !important;
}

.dropdown-menu {
    border: none;
    background-color: var(--dropdown-bg);
    box-shadow: 0 5px 15px var(--shadow-color);
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}

.dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: middle;
}

.profile-img {
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent-color);
}

/* Mobile menu styles */
.mobile-dropdown-menu {
    padding-left: 1.5rem;
}

/* Country flag styles */
.country-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
}

/* Fullscreen icon */
.fullscreen-icon {
    transition: all 0.3s ease;
}

.fullscreen-icon:hover {
    transform: scale(1.1);
}

/* Dark mode toggle */
.dark-mode-toggle {
    position: relative;
    width: 40px;
    height: 20px;
    border-radius: 10px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: background-color 0.3s;
}

.dark-mode-toggle.active {
    background-color: var(--accent-color);
}

.dark-mode-toggle .toggle-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--bg-primary);
    border-radius: 50%;
    transition: transform 0.3s;
}

.dark-mode-toggle.active .toggle-handle {
    transform: translateX(20px);
}

/* Status indicator */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-online {
    background-color: var(--success-bg);
}

.status-offline {
    background-color: var(--text-secondary);
}

.status-busy {
    background-color: var(--danger-bg);
}

/* Quick stats */
.quick-stat {
    padding: 8px;
    border-radius: 6px;
    background-color: var(--bg-secondary);
    margin-bottom: 5px;
}

.quick-stat i {
    font-size: 1.2rem;
    margin-right: 8px;
    color: var(--accent-color);
}

/* Weather widget */
.weather-widget {
    padding: 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--info-bg), var(--accent-color));
    color: white;
}

.weather-temp {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Calendar widget */
.calendar-widget {
    padding: 10px;
}

.calendar-date {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-color);
}

.calendar-day {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Chat Sidebar Styles */
.chat-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -2px 0 10px var(--shadow-color);
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chat-sidebar.active {
    right: 0;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.chat-search input {
    border-radius: 20px;
    padding-left: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.chat-users {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: calc(100vh - 250px);
}

.chat-user {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-user:hover {
    background-color: var(--hover-bg);
}

.chat-user.active {
    background-color: var(--accent-color);
    color: white;
}

.chat-user img {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
}

.chat-user-info {
    flex: 1;
}

.chat-user-info h6 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.chat-user-info small {
    font-size: 0.75rem;
}

.chat-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

/* Dark mode styles for chat sidebar */
body.dark-mode .chat-sidebar {
    background: var(--bg-primary);
    box-shadow: -2px 0 10px var(--shadow-color);
}

body.dark-mode .chat-header {
    background: var(--bg-primary);
    border-bottom-color: var(--border-color);
}

body.dark-mode .chat-search input {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .chat-user:hover {
    background-color: var(--hover-bg);
}

body.dark-mode .chat-user.active {
    background-color: var(--accent-color);
    color: white;
}

body.dark-mode .chat-footer {
    background: var(--bg-primary);
    border-top-color: var(--border-color);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Chat Tabs Styles */
.chat-sidebar .nav-tabs {
    border-bottom: 1px solid var(--border-color);
    margin: 0 -1rem;
    padding: 0 1rem;
}

.chat-sidebar .nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    margin-right: 1rem;
}

.chat-sidebar .nav-tabs .nav-link:hover {
    color: var(--accent-color);
    border: none;
}

.chat-sidebar .nav-tabs .nav-link.active {
    color: var(--accent-color);
    background: none;
    border: none;
}

.chat-sidebar .nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
}

/* Dark mode styles for chat tabs */
body.dark-mode .chat-sidebar .nav-tabs {
    border-bottom-color: var(--border-color);
}

body.dark-mode .chat-sidebar .nav-tabs .nav-link {
    color: var(--text-primary);
}

body.dark-mode .chat-sidebar .nav-tabs .nav-link:hover,
body.dark-mode .chat-sidebar .nav-tabs .nav-link.active {
    color: var(--accent-color);
}

body.dark-mode .chat-sidebar .nav-tabs .nav-link.active::after {
    background-color: var(--accent-color);
}

/* Chat Content Styles */
.chat-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Chat Window Styles */
.chat-window {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.chat-window-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-window-header .btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.chat-window-header .btn-back:hover {
    color: var(--accent-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
}

.message.received {
    align-self: flex-start;
    background: var(--bg-secondary);
    border-bottom-left-radius: 0.25rem;
    color: var(--text-primary);
}

.message.sent {
    align-self: flex-end;
    background: var(--accent-color);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message-time {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.chat-input-area .input-group {
    background: var(--bg-secondary);
    border-radius: 1.5rem;
    padding: 0.25rem;
}

.chat-input-area input {
    border: none;
    background: none;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
}

.chat-input-area input:focus {
    box-shadow: none;
}

.chat-input-area .btn {
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
}

/* Dark mode styles for chat window */
body.dark-mode .chat-window {
    background: var(--bg-primary);
}

body.dark-mode .chat-window-header {
    border-bottom-color: var(--border-color);
}

body.dark-mode .chat-window-header .btn-back {
    color: var(--text-primary);
}

body.dark-mode .chat-window-header .btn-back:hover {
    color: var(--accent-color);
}

body.dark-mode .message.received {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode .message.sent {
    background: var(--accent-color);
}

body.dark-mode .chat-input-area {
    background: var(--bg-primary);
    border-top-color: var(--border-color);
}

body.dark-mode .chat-input-area .input-group {
    background: var(--bg-secondary);
}

body.dark-mode .chat-input-area input {
    color: var(--text-primary);
}

body.dark-mode .chat-input-area input::placeholder {
    color: var(--text-secondary);
}

/* Welcome Image Styles */
.welcome-img {
    object-fit: contain;
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

/* SVG Container Styles */
svg {
    width: 100%;
    height: auto;
    max-width: 100%;
    overflow: visible;
}

/* Dark mode styles */
body.dark-mode {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-mode .navbar {
    background-color: var(--bg-primary) !important;
    box-shadow: 0 2px 10px var(--shadow-color);
}

body.dark-mode .nav-link {
    color: var(--text-primary) !important;
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
    color: var(--accent-color) !important;
}

body.dark-mode .dropdown-menu {
    background-color: var(--dropdown-bg);
    border-color: var(--border-color);
    box-shadow: 0 5px 15px var(--shadow-color);
}

body.dark-mode .dropdown-item {
    color: var(--text-primary);
}

body.dark-mode .dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}

body.dark-mode .dropdown-divider {
    border-color: var(--border-color);
}

body.dark-mode .text-muted {
    color: var(--text-secondary) !important;
}

body.dark-mode .bg-light {
    background-color: var(--bg-secondary) !important;
}

body.dark-mode .border-bottom,
body.dark-mode .border-top {
    border-color: var(--border-color) !important;
}

body.dark-mode .hover-bg-light:hover {
    background-color: var(--hover-bg) !important;
}

body.dark-mode .text-dark {
    color: var(--text-primary) !important;
}

body.dark-mode .text-primary {
    color: var(--accent-color) !important;
}

/* --- Notification Dropdown (New Design) --- */

/* Remove old notification styles */
.notification-badge { display: none !important; }
.bg-success, .bg-info, .bg-warning, .bg-danger { background: none !important; }

/* New notification dropdown styles */
.dropdown-menu[style*="width: 400px"] {
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: none;
  padding-bottom: 1rem;
}

.dropdown-menu .nav-tabs {
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0.5rem;
}
.dropdown-menu .nav-link {
  border: none;
  background: none;
  color: #6b7280;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 1.5rem 0.5rem 0;
  margin-right: 1.5rem;
  border-radius: 0;
}
.dropdown-menu .nav-link.active {
  color: #047857;
  border-bottom: 2px solid #047857;
  background: none;
}

/* .dropdown-menu .dropdown-item {
  border-radius: 12px;
  margin: 0.25rem 0.5rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  transition: background 0.2s;
} */
.dropdown-menu .dropdown-item:hover {
  background: #f3f4f6;
}

.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  margin-right: 1rem;
}

/* Example avatar backgrounds */
.notification-avatar.bg-red { background: #ffeaea; color: #e74c3c; }
.notification-avatar.bg-blue { background: #eaf1ff; color: #3b82f6; }
.notification-avatar.bg-green { background: #eaffea; color: #10b981; }

.dropdown-menu .fw-bold {
  font-size: 1.05rem;
}

.dropdown-menu .text-muted.small {
  font-size: 0.85rem;
}

.dropdown-menu .ms-2.fw-bold {
  font-size: 1.2rem;
  color: #6b7280;
}