:root {
    /* Dark blue-green theme colors */
    --primary-color: #3CAEA3;       /* Teal blue-green */
    --secondary-color: #20639B;     /* Deep blue with slight green tint */
    --bg-color: #173F5F;            /* Dark blue background */
    --darker-bg: #0F2942;           /* Darker shade for contrast */
    --text-color: #F6F1D1;          /* Warm light color for text */
    --accent-color: #48D1CC;        /* Bright turquoise accent */
    --crisis-color: #ED553B;        /* Coral for crisis alerts */
    
    /* Layout variables */
    --sidebar-width: 250px;
    --navbar-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--darker-bg);
    padding: 20px;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.sidebar-header img {
    width: 50px;
    margin-right: 10px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(60, 174, 163, 0.3);
    background-color: transparent;
}

.feature-item {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-item:hover {
    background-color: rgba(60, 174, 163, 0.2);
    transform: translateX(3px);
}

.feature-item a {
    text-decoration: none;
    color: white;
}

.feature-item i {
    color: var(--accent-color);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}


/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 200;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Navbar */
.navbar {
    height: var(--navbar-height);
    background-color: var(--darker-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    width: 45px;
    margin-right: 15px;
    border-radius: 50%;
    object-fit: contain;
    background-color: transparent;
}

.logo h1 {
    background: linear-gradient(45deg, var(--text-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
}

.nav-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--darker-bg);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 1;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: rgba(60, 174, 163, 0.2);
    padding-left: 20px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--bg-color), var(--darker-bg));
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    background-color: var(--secondary-color);
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 0;
}

.user-message {
    background-color: var(--primary-color);
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.message p {
    margin-bottom: 5px;
}

.message small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
    font-style: italic;
}

.crisis-resources {
    background-color: rgba(237, 85, 59, 0.1);
    border-left: 4px solid var(--crisis-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: none;
}

.crisis-resources h3 {
    color: var(--crisis-color);
    margin-bottom: 10px;
}

.crisis-resources ul {
    list-style-type: none;
}

.crisis-resources li {
    margin-bottom: 5px;
}

.user-input {
    display: flex;
    gap: 10px;
}

textarea {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-color);
    resize: none;
    height: 60px;
    font-family: inherit;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(60, 174, 163, 0.2);
}

textarea::placeholder {
    color: rgba(230,241,255,0.5);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Media queries for responsiveness */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .message {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .navbar {
        padding-left: 60px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .dropdown-content {
        position: absolute;
        right: 0;
        left: auto;
    }
}

@media (max-width: 576px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
        padding-left: 60px;
    }
    
    .logo {
        margin-bottom: 10px;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    
    .btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .chat-container {
        padding: 10px;
    }
    
    .message {
        max-width: 95%;
        padding: 12px;
    }
    
    .user-input {
        flex-direction: column;
    }
    
    textarea {
        height: 80px;
    }
    
    button#send-btn {
        height: 40px;
    }
}

@media (max-width: 380px) {
    .navbar {
        padding-left: 50px;
    }
    
    .logo img {
        height: 30px;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .nav-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-actions .btn,
    .nav-actions .dropdown {
        width: 100%;
    }
    
    .messages {
        padding: 5px;
    }
    
    .crisis-resources {
        padding: 10px;
    }
    
    .crisis-resources h3 {
        font-size: 1rem;
    }
}