:root {
    /* Light mode colors */
    --bs-primary: #1a3d51;
    --bs-secondary: #d7b085;
    --nav-active-color: #d7b085;
    --heading-color: #1a3d51; /* Added for consistent headings */
    --article-bg: rgba(255, 255, 255, 0.95);
    --article-text: #333;
    --article-meta: #6c757d;
    --article-hr: rgba(215, 176, 133, 0.3);
    --comment-form-bg: #f8f9fa;
    --comment-label: #495057;
    --comment-input-bg: #fff;
    --comment-input-border: #ced4da;
    --comment-input-text: #495057;
    
    --comment-bg: #f8f9fa;
    --comment-border: #e9ecef;
    --comment-text: #495057;
    --comment-meta: #6c757d;
    --comment-content-text: #212529;
}

.dark-mode {
    /* Dark mode colors */
    --bs-primary: #d7b085;
    --bs-secondary: #1a3d51;
    --nav-active-color: #d7b085;
    --heading-color: #d7b085;
    --article-bg: rgba(26, 61, 81, 0.95);
    --article-text: #f0f0f0;
    --article-meta: #d7b085;
    --article-hr: rgba(215, 176, 133, 0.3);
    --comment-form-bg: #2c3e50;
    --comment-label: #d7b085;
    --comment-input-bg: #34495e;
    --comment-input-border: #4a6278;
    --comment-input-text: #f0f0f0;
    
    --comment-bg: #2c3e50;
    --comment-border: #34495e;
    --comment-text: #f8f9fa;
    --comment-meta: #adb5bd;
    --comment-content-text: #f8f9fa;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: #000000; /* or #000 depending on light/dark mode */
    background-color: #1a3d51; /* example dark mode background */
}
body.dark-mode {
    color: #fff;
    background-color: #ffffff; 
}

/* Base heading styles */
h1, h2, h3, .hero-title, .section-title {
    font-family: 'DM Serif Text', serif;
    font-weight: 400;
    color: #1a3d51; /* default (light mode) color */
}

/* When parent has dark-mode class */
.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode .hero-title,
.dark-mode .section-title {
    color: #d7b085;
}

/*** Button Start ***/
.btn {
    font-weight: 600;
    transition: .5s;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-md-square {
    width: 46px;
    height: 46px;
}

.btn-lg-square {
    width: 58px;
    height: 58px;
}

.btn-square,
.btn-sm-square,
.btn-md-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.back-to-top {
    position: fixed;
    width: 50px;
    height: 50px;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

/* Button Styles */
.btn-secondary {
    background-color: var(--bs-secondary); /* #d7b085 */
    border-color: var(--bs-secondary); /* #d7b085 */
    color: var(--bs-white); /* Ensure readable text */
}

.btn-secondary:hover {
    background-color: var(--bs-primary); /* #1a3d51 */
    border-color: var(--bs-primary); /* #1a3d51 */
    color: var(--bs-white);
}

.btn-secondary:active, 
.btn-secondary:focus, 
.btn-secondary.active, 
.btn-secondary:focus-visible {
    background-color: var(--bs-primary) !important; /* #1a3d51 */
    border-color: var(--bs-primary) !important; /* #1a3d51 */
    color: var(--bs-white) !important;
    box-shadow: 0 0 0 0.25rem rgba(26, 61, 81, 0.5) !important; /* Match --bs-primary with 50% opacity */
}
/*** Button End ***/

/*** Navbar Start ***/
.navbar .navbar-nav {
    padding: 15px 0;
}

.navbar .navbar-nav .nav-link {
    padding: 10px 15px;
    color: var(--navbar-text-color, var(--bs-white));
    font-size: 18px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
}

/* Active and hover states */
.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--nav-active-color) !important;
}

/* Active link underline effect */
.navbar .navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 2px;
    background-color: var(--nav-active-color);
    transform: scaleX(1);
}

/* Dropdown toggle arrow */
.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "font awesome 5 free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
    transition: all 0.3s ease;
}

/* Dropdown menu animation */
@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        transition: all 0.3s ease;
        opacity: 0;
        border: none;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    body.dark-mode .navbar .nav-item .dropdown-menu {
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
}

.navbar .nav-item:hover .dropdown-menu {
    transform: rotateX(0deg);
    visibility: visible;
    opacity: 1;
}

/* Dropdown items */
.navbar .dropdown-item {
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: var(--nav-active-color);
    color: #fff !important;
}
/*** Navbar End ***/

/*** Skills Start ***/
.services .services-item {
    box-shadow: 0 0 60px rgba(0, 0, 0, .2);
    width: 100%;
    height: 100%;
    border-radius: 10px;
    padding: 10px 0;
    position: relative;
    background-color: var(--bs-light);
    color: var(--bs-primary);
    transition: all 0.5s ease;
    overflow: hidden;
}

/* Light mode hover effect (white → primary) */
.services-content::after {
    position: absolute;
    content: "";
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    border-radius: 10px;
    background: var(--bs-primary);
    transition: height 0.5s ease;
    z-index: 0;
}

.services-item:hover .services-content::after {
    height: 100%;
}

.services-content-icon {
    position: relative;
    z-index: 2;
}

.services-content-icon i,
.services-content-icon p,
.services-content-icon h4,
.services-content-icon h5,
.services-content-icon span,
.services-content-icon a {
    color: var(--bs-primary);
    transition: color 0.5s ease;
}

.services-item:hover .services-content-icon i,
.services-item:hover .services-content-icon p,
.services-item:hover .services-content-icon h4,
.services-item:hover .services-content-icon h5,
.services-item:hover .services-content-icon span,
.services-item:hover .services-content-icon a {
    color: var(--bs-white) !important;
}

/* Dark mode styles - inverted colors */
body.dark-mode .services .services-item {
    background-color: var(--bs-secondary) !important; /* Dark blue background */
    color: var(--bs-white) !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, .5);
}

/* Dark mode hover effect (blue → white) */
body.dark-mode .services-content::after {
    background: var(--bs-white);
}

body.dark-mode .services-content-icon i,
body.dark-mode .services-content-icon p,
body.dark-mode .services-content-icon h4,
body.dark-mode .services-content-icon h5,
body.dark-mode .services-content-icon span,
body.dark-mode .services-content-icon a {
    color: var(--bs-white) !important;
}

body.dark-mode .services-item:hover .services-content-icon i,
body.dark-mode .services-item:hover .services-content-icon p,
body.dark-mode .services-item:hover .services-content-icon h4,
body.dark-mode .services-item:hover .services-content-icon h5,
body.dark-mode .services-item:hover .services-content-icon span,
body.dark-mode .services-item:hover .services-content-icon a {
    color: var(--bs-secondary) !important; /* Dark blue text on hover */
}

/* Ensure text remains visible during transition */
.services-content-text {
    position: relative;
    z-index: 2;
}
/*** Skills End ***/

/*** Project Start ***/
.project-img {
    position: relative;
    padding: 15px;
}

.project-img::before {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    top: 0;
    left: 0;
    background: var(--project-before-bg, var(--bs-secondary));
    border-radius: 10px;
    opacity: 1;
    z-index: -1;
    transition: .5s;
}

.project-img::after {
    content: "";
    width: 150px;
    height: 150px;
    position: absolute;
    right: 0;
    bottom: 0;
    background: var(--project-after-bg, var(--bs-primary));
    border-radius: 10px;
    opacity: 1;
    z-index: -1;
    transition: .5s;
}

.project-content {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.project-content a {
    display: inline-block;
    padding: 20px 25px;
    background: var(--project-link-bg, var(--bs-primary));
    border-radius: 10px;
}

.project-item:hover .project-content {
    opacity: 1;
    transition: .5s;
}

.project-item:hover .project-img::before,
.project-item:hover .project-img::after {
    opacity: 0;
}

/* Dark mode override to keep light mode colors in project section */
.dark-mode {
    --project-before-bg: #d7b085; /* light mode --bs-secondary */
    --project-after-bg: #1a3d51;  /* light mode --bs-primary */
    --project-link-bg: #1a3d51;   /* light mode --bs-primary */
}
/*** Project End ***/

/*** Testimonial Start ***/
.testimonial-item {
    background: #e3f0eb; /* Fixed light background */
    color: #1a3d51 !important;  /* Fixed dark blue text */
    border: 1px solid #d7b085; /* Fixed gold border */
}

.testimonial-item * {
    color: #1a3d51 !important;  /* Fixed dark blue for all child elements */
}

/* Remove dark mode overrides */
.testimonial-carousel .owl-dots {
    margin-top: 15px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 0 5px;
    width: 15px;
    height: 15px;
    background: #c1dad0; /* Fixed light color */
    border-radius: 15px;
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    width: 30px;
    background: #1a3d51; /* Fixed dark blue */
}

.testimonial-carousel .owl-item.center {
    position: relative;
    z-index: 1;
}

.testimonial-carousel .owl-item .testimonial-item {
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-item {
    background: #FFFFFF !important; /* Fixed white background */
    box-shadow: 0 0 30px #DDDDDD;
    border: 2px solid #d7b085; /* Enhanced gold border for center item */
}
/*** Testimonial End ***/

/*** Contact Start ***/
.contact-detail::before {
    position: absolute;
    content: "";
    height: 50%;
    width: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(rgb(210, 243, 235, 1), rgba(230, 250, 245, .3)), url(../img/background.jpg) center center no-repeat;
    background-size: cover;
    border-radius: 10px;
    z-index: -1;
}

.contact-map {
    background: var(--contact-map-bg, #173648);
}

.contact-form {
    background: var(--contact-form-bg, #173648);
}
/*** Contact End ***/

/*** Footer Start ***/
.footer .short-link a,
.footer .help-link a,
.footer .contact-link a {
    transition: .5s;
}

.footer .short-link a:hover,
.footer .help-link a:hover,
.footer .contact-link a:hover {
    letter-spacing: 1px;
}

.footer .hightech-link a:hover {
    background: var(--bs-secondary);
    border: 0;
}
/*** Footer End ***/

/*** Animus Background Start ***/
.animus-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: rgba(255, 255, 255, 0.95);
    overflow: hidden;
    transition: background 0.5s ease, opacity 0.5s ease;
}

.animus-background.dark-mode {
    background: rgba(10, 20, 30, 0.95);
}

.animus-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 162, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 162, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: animusGridMove 20s linear infinite;
}

.animus-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(0, 162, 255, 0.05) 50%, 
        transparent 100%);
    animation: animusScan 8s linear infinite;
    opacity: 0.7;
}

.animus-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.animus-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 162, 255, 0.7);
    border-radius: 50%;
    animation: animusParticle 10s linear infinite;
    box-shadow: 0 0 5px 1px rgba(0, 200, 255, 0.5);
}

@keyframes animusGridMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

@keyframes animusScan {
    0% { top: -100%; }
    100% { top: 100%; }
}

@keyframes animusParticle {
    0% { 
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}
/*** Animus Background End ***/

/*** Alert Messages ***/
.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}

/*** Spinner ***/
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Testimonial text with line clamping */
.testimonial-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Read more button styling */
.read-more-btn {
    background: none;
    border: none;
    color: #0d6efd; /* Bootstrap primary color */
    padding: 0;
    margin-top: 8px;
    cursor: pointer;
}

.read-more-btn:hover {
    text-decoration: underline;
}

.mstag-toggle {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.mstag-toggle:hover {
    text-decoration: underline;
}

/*** Enhanced Chatbot Styles ***/
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.chatbot-bubble {
    width: 60px;
    height: 60px;
    background-color: var(--bs-primary);
    border: 2px solid var(--bs-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    background-color: var(--bs-secondary);
    border-color: var(--bs-primary);
}

.chatbot-bubble:hover i {
    color: var(--bs-primary);
}

.chatbot-bubble i {
    font-size: 24px;
    color: white;
    transition: all 0.3s ease;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid var(--bs-secondary);
}

.dark-mode .chatbot-window {
    background-color: var(--article-bg);
    border: 2px solid var(--bs-primary);
}

/*** Enhanced Chatbot Header Styles ***/
.chatbot-header {
    padding: 3px;
    background-color: var(--bs-primary);
    color: var(--bs-secondary); /* Changed to secondary color for better contrast */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--bs-secondary);
}

.dark-mode .chatbot-header {
    background-color: var(--bs-primary);
    color: white; /* White text in dark mode for better visibility */
    border-bottom-color: var(--bs-secondary);
}

.chatbot-header .fa-robot {
    font-size: 1.5rem;
    color: var(--bs-secondary); /* Robot icon matches secondary color */
    margin-right: 10px;
}

.dark-mode .chatbot-header .fa-robot {
    color: white; /* White icon in dark mode */
}

.chatbot-header h5 {
    font-family: 'DM Serif Text', serif;
    font-weight: 400;
    margin: 0;
    font-size: 1.2rem;
    color: white; /* White in light mode */
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
}

.chatbot-close-btn:hover {
    background-color: rgba(215, 176, 133, 0.2); /* Semi-transparent secondary color */
    transform: rotate(90deg);
    color: white;
}

.dark-mode .chatbot-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--bs-secondary);
}

.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 400px;
    background-color: rgba(255, 255, 255, 0.95);
}

.dark-mode .chatbot-messages {
    background-color: rgba(26, 61, 81, 0.95);
}

/* Message styles */
.message {
    margin-bottom: 15px;
    max-width: 80%;
    padding: 12px 15px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-message {
    background-color: var(--bs-primary);
    color: #ffffff;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    border-top-right-radius: 5px;
    border-top-left-radius: 18px;
}

.dark-mode .user-message {
    background-color: var(--bs-primary);
    color: white;
}

.bot-message {
    background-color: #f1f3f5;
    color: #1a3d51;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border-top-left-radius: 5px;
    border-top-right-radius: 18px;
}

.dark-mode .bot-message {
    background-color: #2b455f;
    color: white;
}

/* Message sender labels */
.message-sender {
    font-weight: bold;
    font-size: 0.8em;
    margin-bottom: 4px;
    display: block;
}

.user-message .message-sender {
    color: var(--bs-primary);
    text-align: right;
}

.dark-mode .user-message .message-sender {
    color: white;
}

.bot-message .message-sender {
    color: var(--bs-primary);
    text-align: left;
}

.dark-mode .bot-message .message-sender {
    color: var(--bs-secondary);
}

/* Input area */
.chatbot-input-container {
    display: flex;
    padding: 12px;
    border-top: 2px solid var(--bs-secondary);
    background-color: white;
}

.dark-mode .chatbot-input-container {
    border-top: 2px solid var(--bs-primary);
    background-color: var(--article-bg);
}

.chatbot-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    margin-right: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(215, 176, 133, 0.3);
}

.dark-mode .chatbot-input {
    background-color: var(--comment-input-bg);
    border-color: var(--bs-primary);
    color: white;
}

.chatbot-send-btn {
    background-color: var(--bs-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send-btn:hover {
    background-color: var(--bs-secondary);
    color: var(--bs-primary);
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    padding: 10px 15px;
    background-color: #f1f3f5;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
}

.dark-mode .typing-indicator {
    background-color: #2d5782;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: var(--bs-primary);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1s infinite ease-in-out;
}

.dark-mode .typing-indicator span {
    background-color: white;
}

/* Message time */
.message-time {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.dark-mode .user-message .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.bot-message .message-time {
    color: rgba(26, 61, 81, 0.6);
}

.dark-mode .bot-message .message-time {
    color: rgba(215, 176, 133, 0.7);
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dark-mode .chatbot-messages::-webkit-scrollbar-track {
    background: #2c3e50;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .chatbot-window {
        width: 300px;
        max-height: 70vh;
    }
}

.chatbot-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    cursor: grab;
    z-index: 9999;
}

.chatbot-bubble:active {
    cursor: grabbing;
}
