/* Global Responsive Fixes */
img, video {
    max-width: 100%;
    height: auto;
}

* {
    box-sizing: border-box;
}

/* Gradient Button */
.gradient-button {
    display: inline-block;
    background: linear-gradient(270deg, brown, white, gray);
    background-size: 500%;
    color: black;
    font-size: large;
    font-weight: bold;
    border: none;
    border-radius: 18px;
    width: 100%;
    max-width: 220px;
    height: 60px;
    animation: gradientAnimation 8s ease infinite;
}

.gradient-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px black;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.nav-item {
    padding: 5px;
    font-weight: bold;
    animation: gradientAnimation 8s ease infinite;
}

.nav-item:hover {
    background-image: linear-gradient(to bottom, blue, aqua);
    border-radius: 18px;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px black;
}

/* Footer */
.nav-item1 {
    padding: 5px;
    font-weight: bold;
}

.nav-item1:hover {
    background-image: linear-gradient(to bottom, gray, black);
    border-radius: 18px;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px black;
}

/* ENG CSS */
.ENG {
    border-radius: 20px;
    background-size: 200% 200%;
    animation: gradientAnimation 10s ease infinite;
    transition: 0.5s ease;
}

.ENG:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px black;
}
.threeD-gallery-section {
    padding: 20px;
    width: 100%;
}

/* Row container */
.threeD-gallery {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    perspective: 1500px;   /* Increased for mobile stability */
}

/* 3D image wrapper */
.img-box {
    width: 500px;
    height: 250px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate3D 7s linear infinite;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    transition: transform .4s ease;
}

/* 3D Animation */
@keyframes rotate3D {
    0%   { transform: rotateY(0deg) rotateX(0deg); }
    25%  { transform: rotateY(90deg) rotateX(5deg); }
    50%  { transform: rotateY(180deg) rotateX(0deg); }
    75%  { transform: rotateY(270deg) rotateX(-5deg); }
    100% { transform: rotateY(360deg) rotateX(0deg); }
}

/* Desktop Hover — mobile/tablet won't apply */
@media (hover:hover) {
    .img-box:hover {
        animation-play-state: paused;
    }
    .img-box:hover img {
        transform: rotateY(20deg) rotateX(10deg) scale(1.08);
    }
}

/* -------- RESPONSIVE FIXES -------- */

/* Tablet */
@media (max-width: 992px) {
    .img-box {
        width: 180px;
        height: 130px;
        animation-duration: 8s; /* smoother */
    }
}

/* Mobile landscape + portrait */
@media (max-width: 768px) {
    .threeD-gallery {
        gap: 12px;
        perspective: 1800px; /* More stable for small screens */
    }
    .img-box {
        width: 150px;
        height: 110px;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .img-box {
        width: 120px;
        height: 90px;
    }
}

/* Extra small */
@media (max-width: 360px) {
    .img-box {
        width: 100px;
        height: 75px;
    }
}

/* Mobile Fixes */
@media(max-width: 768px) {
    h1, .display-5, .display-4, .fs-4 {
        font-size: 1.5rem !important;
    }
    .container-fluid > .d-flex {
        flex-wrap: wrap;
        text-align: center;
    }
    .container-fluid img {
        margin: auto;
    }
    .nav {
        flex-wrap: wrap;
    }
    .threeD-gallery {
        width: 150px;
        height: 150px;
    }
    .threeD-gallery img {
        width: 140px;
        height: 100px;
    }
}

.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 9999;
}

.text1 {
    background: linear-gradient(90deg, #ff0000, #0000ff, #00cc00, #ff9900);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Remove Right-Side White Space */
html, body {
    overflow-x: hidden !important;
}

#chatbot-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #007bff;
  color: white;
  width: 60px;
  height: 60px;
  font-size: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
}

#chatbot-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 320px;
  height: 420px;
  background: white;
  border-radius: 15px;
  display: none;
  flex-direction: column;
  box-shadow: 0px 0px 15px rgba(0,0,0,0.3);
  z-index: 9999;
}

#chatbot-header {
  background: #007bff;
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
}

#chatbot-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

.bot-msg, .user-msg {
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  max-width: 80%;
}

.bot-msg {
  background: #e3f2fd;
}

.user-msg {
  background: #d1ffd1;
  margin-left: auto;
}

#chatbot-input-area {
  display: flex;
  border-top: 1px solid #ddd;
}

#chatbot-input {
  flex: 1;
  border: none;
  padding: 10px;
}

#send-btn {
  width: 60px;
  border: none;
  background: #007bff;
  color: white;
}
