/* ========== GLOBAL RESET ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* ========== BODY & BACKGROUND ========== */
body {
  color: #034b63;
  background-color: #e6fcf7;
  line-height: 1.6;
}

/* Index Page Background */
/* ========== LOGO STYLING ========== */
.logo-img {
  width: 50px;
  height: auto;
  border-radius: 30%;
  display: inline-block;
  vertical-align: middle;
}

/* ========== HERO SECTION ========== */

/* --- Home Hero: Strictly Gradient and Text --- */
.home-hero {
  min-height: 60vh;
  background: linear-gradient(to right, rgb(3, 168, 168, 0.9), rgb(250, 251, 252, 0.6));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(20px, 6vw, 80px); 
  color: white;
  box-sizing: border-box;
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 15px;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(to right, #ffffff, #111111);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.home-hero p {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  max-width: 600px;
  color: #ffffff;
  line-height: 1.5;
  margin-top: 0;
}


/* --- Home Hero 2 Stage Setup --- */
.home-hero2 {
  position: relative;   
  height: 75vh; 
  min-height: 550px;   
  overflow: hidden;   
  width: 100%;   
  background-color: #111111;   
  display: flex;
  flex-direction: column;
  justify-content: center; 
  align-items: center;
  box-sizing: border-box;
}

/* --- Fixed Main Title (Always Visible Over BG) --- */
.title {
  position: absolute; 
  top: 8%; 
  left: 50%;
  transform: translateX(-50%); 
  z-index: 25; 
  color: #ffffff;
  font-size: clamp(26px, 4.5vw, 42px); 
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  text-align: center;
  margin: 0;
  white-space: nowrap;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.5); 
}

/* --- Marquee Track Container Layer --- */
.card-display-frame.marquee-window {
  position: relative;
  z-index: 10; 
  width: 100%;
  max-width: 100%;
  overflow: hidden; 
  display: flex;
  align-items: center;
  margin-top: 40px; 
}

/* FIX: Establishes horizontal flex behavior for your items */
.marquee-track {
  display: flex;
  width: max-content;
  gap: 25vw; /* Creates massive clean horizontal separation between categories */
  padding: 20px 0;
  animation: scrollMarquee 40s linear infinite; 
}

/* Pause on hover functionality */
.marquee-track:hover {
  animation-play-state: paused;
}

/* Individual Category Moving Cards */
.home-card {    
  flex-shrink: 0; 
  font-weight: 800;    
  font-size: clamp(18px, 2.5vw, 26px);    
  text-align: center;   
  color: #ffffff;    
  border: 3px solid #03a8a8;    
  padding: 20px 40px;   
  border-radius: 12px;   
  background: #03a8a8;    
  white-space: nowrap; 
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);     
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.home-card:hover {
  transform: scale(1.04);
  background: #028e8e;
}

/* FIX: Math variables to allow infinite seamless wrapping */
@keyframes scrollMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-50% - 12.5vw)); 
  }
}

/* --- High-Performance Layer Container Framework --- */
.hero2-bg-container {   
  position: absolute;   
  top: 0;   
  left: 0;   
  width: 100%;   
  height: 100%;   
  z-index: 1; 
}  

.hero2-bg-slide {   
  position: absolute;   
  top: 0;   
  left: 0;   
  width: 100%;   
  height: 100%;   
  opacity: 0;   
  will-change: opacity;
  transform: translateZ(0); 
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
}  

/* 1. CRISP, SHARP CENTERED FOREGROUND LAYER */
.hero2-bg-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--slide-img);
  background-size: contain; 
  background-repeat: no-repeat;
  background-position: center center;
  z-index: 2;
}

/* 2. FULL-BLEED SEAMLESS BLURRED SIDE FILLER CANVAS */
.hero2-bg-slide::after {   
  content: '';   
  position: absolute;   
  top: -20px; 
  left: -20px;
  right: -20px;
  bottom: -20px;
  background-image: var(--slide-img);
  background-size: cover; 
  background-position: center center;
  filter: blur(25px) brightness(40%); 
  z-index: 1; 
}  

/* 3. OPTIMIZED DARK OVERLAY FOR TEXT CONTRAST */
/* This element adds a clean, lightweight glass filter to keep text readable */
.hero2-bg-slide::border-box {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  z-index: 3;
}

/* 4. ACTIVE TRANSITION SWITCH STATE TRIGGER */
.hero2-bg-slide.active {   
  opacity: 1; 
}
/*-- Fixed, Clear Action Button Positioning --- */
.more-button {
  position: absolute;
  bottom: 10%; 
  z-index: 25; 
  padding: 14px 32px;
  background: #03a8a8; 
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
  transition: background 0.3s ease, transform 0.2s ease;
}

.more-button:hover {
  background: #028e8e;
  transform: scale(1.05);
}

.more-button a {
  color: #ffffff; 
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  display: inline-block;
}


/* ========== NAVBAR ========== */
.navbar {
  width: 100%;
  background: rgba(3, 75, 99, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Dynamic layout spacing adjustment */
  padding: 15px clamp(15px, 4vw, 60px); 
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
}

.navbar h2 {
  color: #d0f0ff;
  font-weight: 600;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.nav-links {
  display: flex;
  gap: clamp(15px, 2.5vw, 30px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  transition: color 0.3s ease;
  white-space: nowrap; /* Keeps link texts cleanly on a single line */
}

.nav-links a:hover {
  color: #1abc9c;
}

/* ========== TARGETED MOBILE OVERRIDES ========== */
@media (max-width: 768px) {
  /* Stacks navigation components cleanly if links get too wide for mobile screens */
  .navbar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    padding: 15px;
  }
  
  .home-hero {
    align-items: center;
    text-align: center;
  }
}

/*========= PROJECTS SECTION WRAPPER ==========*/
.projects {
  position: relative;
  padding: clamp(40px, 6vw, 80px) clamp(15px, 4vw, 60px);
  text-align: center;
  overflow: hidden;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
}

/* SMOOTH FADE BACKGROUND SLIDESHOW */
.projects::before,
.projects::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: fadeSlide 16s infinite;
}

.projects::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(6, 189, 149, 0.65)),
    url("../uploads/images/pwater.jpg");
}

.projects::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(6, 189, 149, 0.65)),
    url("../uploads/images/pmetal.jpg");
  animation-delay: 8s;
}

@keyframes fadeSlide {
  0% { opacity: 0; transform: scale(1); }
  10% { opacity: 1; }
  45% { opacity: 1; transform: scale(1.05); }
  55% { opacity: 0; }
  100% { opacity: 0; transform: scale(1); }
}

.projects .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  z-index: -1;
}

/*========= ROW MANAGEMENT LAYOUT WRAPPER ==========*/
.projects-wrapper {
  display: flex;
  flex-direction: column;
  gap: clamp(30px, 5vw, 50px);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/*========= INDIVIDUAL CATEGORY BLOCKS ==========*/
.category-section {
  width: 100%;
  display: block;
  text-align: left;
  box-sizing: border-box;
}

/*========= DYNAMIC WRAPPING AUTOMATED GRID ENGINE ==========*/
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(15px, 3vw, 25px);
  padding: 15px 0;
  width: 100%;
  box-sizing: border-box;
}

/*========= EACH PROJECT CARD ==========*/
.project-card {
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 15px;
  overflow: hidden;
  padding: clamp(15px, 3vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 2px solid #1abc9c;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  width: 100%;
}

.project-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 8px 25px rgba(0,0,0,0.18);
}

/*========= CLEAN IMAGE WRAPPER BOX ==========*/
.image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9; 
  overflow: hidden;
  border-radius: 8px;
  margin: 10px 0;
  background-color: #000000;
  position: relative;
  box-sizing: border-box;
}
.image-pro {
  width: 100%;
  height: 100%;
 
  transition: transform 0.3s ease;
}


img.image-pro {
  object-fit: contain;
}

.project-card:hover img.image-pro {
  transform: scale(1.05);
}


/*========= VIDEO WRAPPER ==========*/ 
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; 
    overflow: hidden; 
    border-radius: 12px;
    margin: 15px 0;
    background: #000; 
    
}
.video-wrapperproj {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin: 15px 0;
    background: #000;
}
.video-wrapperproj video {
    width: 100%;
    height: auto;
    display: block;
}

    /*========= VIDEO ==========*/ 
.video-pro {
       position: absolute;
        width: 100%;
        height: 100%; 
        object-fit: cover;
        display: block;
        border-radius: 12px; 
        
    }
.video-proj {
    width: 100%;
    height: auto;
    display: block;
        
    }
    /*auto detect */
    
.video-portrait {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    background: #000;
}




/*========= BORROWED RESPONSIVE VIDEO IFRAME WRAPPER ==========*/
/*.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/*========= HEADINGS & TEXT TYPOGRAPHY ==========*/

.projects h2.main-title {
  margin-top: 0;
  margin-bottom: 30px;
  color: #034b63;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
}

.pro_h2 {
  color: #034b63;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: bold;
  font-family: Arial Black, sans-serif;
  margin-bottom: 10px;
  text-transform: uppercase;
  border-bottom: 2px solid #1abc9c;
  padding-bottom: 5px;
  display: inline-block;
}

.project-card h3 {
  margin: 0 0 10px 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 600;
  color: #034b63;
  line-height: 1.3;
}

.project-card p {
  margin: 10px 0;
  flex-grow: 1;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.5;
}

/*========= INTERACTION BUTTONS ==========*/
.project-card a.readmore-btn {
  margin-top: 15px;
  padding: 10px 16px;
  background: #1abc9c;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

.project-card a.readmore-btn:hover {
  background: #05668d;
  transform: scale(1.02);
}

.project-card button {
  background: green;
  color: white;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.project-card button:hover {
  background: darkgreen;
}

/*========= NARROW SCREEN OPTIMIZATIONS ==========*/
@media (max-width: 400px) {
  .card-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .project-card {
    padding: 15px;
  }
}
.category-box{
  margin-bottom: 30px;
  text-align: center;
}

.category-btn{
  background: #06bd95;
  color: white;
  border: solid;
  padding: 15px 30px;
  border-color: black;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  transition: 0.3s;
}

.category-btn:hover{
  background: #034b63;
}

.projects-list{
  margin-top: 25px;

  display: grid;
  grid-template-columns:
  repeat(auto-fit, minmax(300px,1fr));

  gap: 20px;
}


/*========= ABOUT CARDS ==========*/
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  padding: 20px 0;
}
.about-card {
  background: rgba(255,255,255,0.95);

  border-radius: 40px;
  overflow: hidden;
  padding: 18px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  border: 3px solid #1abc9c;

  box-shadow: 0 4px 15px rgba(0,0,0,0.1);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.about-card:hover {
  transform: translateY(-5px);

  box-shadow:
    0 8px 25px rgba(0,0,0,0.15);
}

.about-card ul li {
  color: #034b63;
  text-align: left;
  font-weight: bold;
}

.about-card ul li strong {
  color: #034b63;
}

/*========= ABOUT TITLE ==========*/
.about-card h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
  font-weight: 600;
  color: #034b63;
}

/*========= ABOUT PARAGRAPH ==========*/
.about-card p {
  margin: 12px 0;
  flex-grow: 1;
}


/*========= UNIFIED MEDIA ASPECT RATIO WRAPPER ==========*/
.image-wrapper {
  width: 100%;
  /* Replaces the padding trick with a clean, native 16:9 shape */
  aspect-ratio: 16 / 9; 
  position: relative;
  border-radius: 12px;
  overflow: hidden; /* Restored to clip video backgrounds cleanly */
  margin-bottom: 12px;
  background-color: #000000;
  box-sizing: border-box;
}

/* Unified Media Positioning Layer */
.image-wrapper img,
.image-wrapper video,
.image-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Image Formatting */
.image-wrapper img {
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* IMAGE HOVER ZOOM */
.image-wrapper:hover img {
  transform: scale(1.08);
}

/* Video Stream Correction */
.image-wrapper video {
  /* Forces the browser to scale the video stream inside the box bounds */
  object-fit: contain; 
  background-color: #000000;

}

/* Absolute Positioning Engine across all Project Media Channels */
.image-wrapper img,
.image-wrapper video,
.image-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Specific Formatting Adjustments for Images */
.image-wrapper img {
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* IMAGE HOVER ZOOM */
.image-wrapper:hover img {
  transform: scale(1.08);
}

/* Specific Formatting Adjustments for Native Video Control Panels */
.image-wrapper video {
  object-fit: contain; /* Prevents video dimensions from getting distorted or stretched */
  z-index: 2; /* Forces video elements to sit cleanly on top of container backdrops */
}

/* ========== ABOUT SECTION ========== */
.about {
  padding: 80px 60px;
  background: linear-gradient(to right, #e6fcf7, #d0f0ff);
  text-align: center;
}

.about h2 {
  font-size: 2em;
  color: #034b63;
  margin-bottom: 20px;
}

.about p {
  max-width: 700px;
  margin: 0 auto;
  color: #05668d;
  font-size: 1.1em;
}

/* ========== CONTACT ========== */
.contact {
  padding: 5vw 5%;
  background: linear-gradient(to right, #d0f0ff, #e6fcf7);
  color: #034b63;
  text-align: center;
}

.contact h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 0.5em;
}

.contact p {
  margin-bottom: 2.5em;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: #05668d;
}


/*========= RESPONSIVE CONTACT GRID WRAPPER ==========*/
.contact-container {
  display: flex;
  justify-content: center;
  align-items: stretch; /* Balance row blocks height automatically */
  gap: 30px;
  flex-wrap: wrap;
  border-radius: 12px;
  padding: clamp(15px, 4vw, 40px); /* Fluid inside padding layer */
  margin: 30px auto;
  width: 100%;
  max-width: 1100px;
  box-sizing: border-box;

  /* Modern Gradient Border Architecture Hack */
  background: linear-gradient(white, white) padding-box,
              linear-gradient(to left, #1394cf, #1abc9c) border-box;
  border: 4px solid transparent; 
}

/*========= CONTACT INFO TEXT COLUMN ==========*/
.contact-info {
  flex: 1 1 350px; /* Fluid item scale down to a min-bound of 350px width */
  max-width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.contact-info h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #034b63;
  font-size: 1.5rem;
}

.contact-info p {
  margin: 10px 0;
  color: #333;
  font-size: 1rem;
  line-height: 1.5;
}

.contact-info a {
  color: #1abc9c;
  text-decoration: none;
  font-weight: 500;
}

.contact-info a:hover {
  text-decoration: underline;
}

/*========= INLINE HORIZONTAL SOCIAL LINKS ==========*/
.social-links {
  margin-top: 20px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap; /* Wraps row items safely on narrow windows */
  gap: 15px; 
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* Adds space between logo asset and text string */
  color: #034b63;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.2s ease;
}

.social-links a:hover {
  color: #1abc9c;
  transform: translateY(-2px);
}

/* Consistent Logo Dimensions */
.c_logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ========== FOOTER ========== */
footer {
  background: #034b63;
  color: white;
  text-align: center;
  padding: 20px;
  font-size: 1.2em;
  
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .home-hero {
    padding: 50px 30px;
    align-items: center;
    text-align: center;
  }

  .contact-container {
    flex-direction: column;
    align-items: center;
  }

  .contact-form,
  .contact-info {
    width: 95%;
    text-align: center;
  }
}
/* CAROUSEL WRAPPER */
.carousel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 90px;
  margin-top: 40px;
  perspective: 1000px;
  overflow: hidden;
}

/* INDIVIDUAL CARDS */
.carousel-card {
  background: white;
  width: 260px;
  text-align: center;
  padding: 18px;
  border-radius: 15px;
  transition: transform 0.6s ease, opacity 0.6s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  opacity: 0.5;
}

.carousel-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* CENTER CARD = BIGGER */
.carousel-card.active {
  transform: scale(1.25) translateZ(60px);
  opacity: 1;
}

/* LEFT & RIGHT CARDS = SMALLER */
.carousel-card.left {
  transform: translateX(-120px) scale(0.9);
}

.carousel-card.right {
  transform: translateX(120px) scale(0.9);
}
/*========= ADMIN DASHBOARD MAIN WRAPPER ==========*/
.dashboard {
  width: 100%;
  padding: clamp(15px, 4vw, 40px);
  background: #5b89c5;
  box-sizing: border-box;
  min-height: 100vh;
}

.dashboard h1 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #038383;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

/*========= DASHBOARD DATA SUBMIT FORM ==========*/
.dashboard-form {
  display: flex; /* FIXED: Declared flex layout to activate properties below */
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.dashboard h3 {
  margin-top: 20px;
  margin-bottom: 15px;
  color: #037927;
  font-family: 'Arial Black', sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  padding-left: clamp(0px, 4vw, 20px); /* FIXED: Removed rigid 60px margin */
}

.dashboard hr {
  border: 0;
  border-top: 2px solid #020503;
  margin: 25px 0;
  width: 100%;
}

/*========= AD-PROJECTS CONTAINER BLOCK ==========*/
.ad-projects {
  border-radius: 12px; /* FIXED: Lowered from 100px to prevent mobile distortion */
  border: 4px solid #037927;  
  font-family: monospace;
  background-color: #ccc;
  padding: clamp(15px, 3vw, 25px);
  margin: 20px 0;
  box-sizing: border-box;
  width: 100%;
}

.projects-list {
  font-family: monospace;
  color: #034b63;
  font-size: 1rem;
  padding: 10px 0;
  box-sizing: border-box;
}

/* Helper line layout container inside admin list tracking view */
.projects-list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

/*========= CONTACT MESSAGES MANAGER PANEL ==========*/
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

.message-card {
  background: white;
  padding: clamp(15px, 3vw, 25px);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap; /* Auto-stacks elements on tablet breakdown thresholds */
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

.message-info {
  flex: 1 1 300px; /* Fluid sizing: shrinks or wraps on small displays */
  max-width: 100%;
}

.message-info h3 {
  margin-top: 0;
  color: #002147;
  font-size: 1.2rem;
}

.reply-box {
  flex: 1 1 300px; /* Fluid sizing: matches info container wrapping layout */
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
}

.reply-box textarea {
  width: 100%;
  height: 100px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  resize: vertical;
}

.reply-box input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

.reply-btn {
  background: #002147;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
}

.reply-btn:hover {
  background: #FFD700;
  color: black;
}

/* Legacy Message Post Block Safety */
.msg {
  border: 1px solid #ddd;
  padding: 15px;
  margin: 15px 0;
  background: white;
  border-radius: 6px;
  box-sizing: border-box;
}
.msg textarea {
  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
}

/*========= COMPONENT GLOBAL FORM CONTROLS ==========*/
form {
  background: white;
  padding: clamp(15px, 4vw, 30px);
  max-width: 500px;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  box-sizing: border-box;
  width: 100%;
}

input, select, textarea {
  width: 100%;
  margin: 8px 0 16px 0;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

button {
  background: green;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background 0.2s ease;
  width: 100%; /* Spans full form width on mobile screens */
}
button:hover {
  background: darkgreen;
}

h2 {
  text-align: center;
  margin-top: 0;
  color: #034b63;
}

/*========= CATEGORY MANAGER MANAGEMENT ==========*/
.category-manager {
  margin: 20px 0;
  padding: clamp(15px, 3vw, 25px);
  background: #e6fcf7;
  border-radius: 10px;
  border: 2px solid #1abc9c;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.category-item {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap; /* Stacks layout elements linearly on smart screens */
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 2px solid #1abc9c;
  gap: 15px;
  box-sizing: border-box;
  width: 100%;
}

.cat-form {
  display: flex;
  gap: 10px;
  flex: 1 1 250px; /* Fluid scaling bounds definition */
  width: 100%;
}
.cat-form input {
  margin: 0; /* Clear global margins inside horizontal sub-form line */
}

.edit-btn {
  background: #05668d;
  width: auto; /* Keeps update button compact inside individual rows */
}
.edit-btn:hover {
  background: #034b63;
}

.delete-btn {
  background: red;
  color: white;
  padding: 10px 15px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.95rem;
  text-align: center;
  transition: background 0.2s;
  flex: 0 0 auto;
}
.delete-btn:hover {
  background: darkred;
}

/*========= SINGLE PROJECT DETAILS VIEWER PAGE ==========*/
.project-details {
  max-width: 1100px;
  margin: clamp(20px, 5vw, 50px) auto;
  padding: clamp(15px, 4vw, 35px);
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  box-sizing: border-box;
  width: 100%;
}

.project-details h1 {
  color: #034b63;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.project-category {
  color: #05668d;
  margin-bottom: 25px;
  font-weight: 600;
  font-size: 1.1rem;
}

/* GALLERY GRID LAYER MECHANISM */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adaptive wrapping column tracks */
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.project-gallery img,
.project-gallery video {
  width: 100%;
  height: 240px;
  object-fit: cover; /* Keeps media thumbnails perfectly proportioned */
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  background-color: #000;
}

.project-description {
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.project-description h3 {
  color: #034b63;
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.4rem;
  padding-left: 0; /* Clears admin dashboard h3 side indentation override hook */
}

.project-description p {
  line-height: 1.7;
  color: #444;
  font-size: 1.05rem;
}

/* MANAGEMENT ROUTING ACTION WRAPPERS */
.project-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap; /* Stacks buttons vertically on narrow smartphones */
  gap: 15px;
  width: 100%;
}

.project-actions a {
  background: #1abc9c;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: background 0.2s, transform 0.2s;
  flex: 1 1 150px; /* Stretches buttons to fit screens nicely on mobile */
  max-width: 100%;
}
.project-actions a:hover {
  background: #05668d;
  transform: translateY(-2px);
}

.back-link {
  text-align: center;
  font-family: Arial, sans-serif;
  font-weight: bold;
  margin-top: 25px;
  display: block;
}
.back-link a {
  color: #05668d;
  text-decoration: none;
}
.back-link a:hover {
  text-decoration: underline;
}

/*========= CRITICAL SMARTPHONE ADJUSTMENT BLOCK ==========*/
@media (max-width: 500px) {
  .cat-form {
    flex-direction: column; /* Stacks inline category rename editing inputs vertically */
  }
  .edit-btn, .delete-btn {
    width: 100%; /* Makes buttons full-width for easy tapping on mobile */
  }
  .project-gallery img,
  .project-gallery video {
    height: 200px; /* Reduces gallery card height slightly on tiny mobile phone screens */
  }
}
