/* 
 * styles.css - Integrated Corporate Identity & Neumorphism UI
 * Programmed by CarlosGTI001 DEV
 */

:root {
  --primary: #E6E6E6; /* Gris Claro from manual.png */
  --bg-soft: #E6E6E6;
  --brand-blue: #0D284F; /* Azul Corporativo from manual.png */
  --brand-gray: #757575; /* Gris from manual.png */
  --dark: #0D284F;
  --secondary: #757575;
  --text-dark: #0D284F;
  --text-muted: #757575;
}

body {
  background-color: var(--primary) !important;
  color: var(--brand-blue);
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
}

/* Typography from manual.png */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700 !important;
  color: var(--brand-blue);
}

/* Header Refinements (Neumorphism & Opacity) */
.navbar-main {
  background-color: rgba(230, 230, 230, 0.85) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 10px rgba(187, 199, 219, 0.3) !important;
  transition: all 0.3s ease;
}

.header-global {
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1000;
}

body:not(.home-page) .header-global {
  position: sticky;
}

.navbar-main .nav-link {
  color: var(--brand-blue) !important;
  font-weight: 600;
  padding: 0.5rem 1.25rem !important;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
  box-shadow: inset 2px 2px 5px #b8b9be, inset -3px -3px 7px #ffffff !important;
}

.navbar-brand img {
  height: 60px !important;
  width: auto !important;
}

/* Admin Panel Structural Layout */
.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background-color: var(--primary);
}

.admin-sidebar {
  padding: 2.5rem 1.5rem;
  box-shadow: 6px 0 12px rgba(187, 199, 219, 0.4);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  overflow-y: auto;
  background-color: var(--primary) !important;
}

.admin-sidebar h2 {
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-sidebar .nav-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-gray) !important;
}

.admin-sidebar .nav-link:hover, 
.admin-sidebar .nav-link.active {
  box-shadow: inset 3px 3px 6px #b8b9be, inset -3px -3px 7px #ffffff !important;
  background-color: transparent !important;
  color: var(--brand-blue) !important;
}

.admin-main {
  padding: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.admin-page-head {
  margin-bottom: 2.5rem;
}

.admin-card, .card {
  border-radius: 1.25rem;
  background-color: var(--primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* Brand buttons for Public Site */
body:not(.admin-body) .btn-primary {
  background-color: var(--brand-blue) !important;
  border-color: var(--brand-blue) !important;
  color: #ffffff !important;
  box-shadow: 3px 3px 6px #b8b9be, -3px -3px 7px #ffffff !important;
  font-weight: 700;
}

body:not(.admin-body) .btn-primary:hover {
  background-color: #0a1f3d !important;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.2) !important;
}

/* Admin buttons */
.admin-body .btn-primary, .admin-body .btn-secondary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--brand-blue) !important;
  box-shadow: 3px 3px 6px #b8b9be, -3px -3px 7px #ffffff !important;
}

/* Hero Section Adjustments */
.unified-hero-section {
  margin-top: 80px;
}

.home-page .unified-hero-section {
  margin-top: 0;
}

.section-full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.img-ratio-hero {
  height: 680px;
  width: 100%;
  object-fit: cover;
}

@media (max-width: 767.98px) {
  .img-ratio-hero {
    height: 430px;
    filter: blur(2px);
    transform: scale(1.05);
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 1;
}

.shadow-text {
  text-shadow: 
    -1px -1px 0 rgba(0,0,0,0.9),  
     1px -1px 0 rgba(0,0,0,0.9),
    -1px  1px 0 rgba(0,0,0,0.9),
     1px  1px 0 rgba(0,0,0,0.9),
     2px 2px 12px rgba(0,0,0,1);
}

.carousel-caption {
  z-index: 2;
  width: 100%;
  max-width: 650px;
  padding: 20px;
  overflow-wrap: break-word;
}

/* Modal Backdrop Blur */
.modal-backdrop {
  backdrop-filter: blur(4px);
  background-color: rgba(13, 40, 79, 0.2) !important;
}

/* Modal Refinements (Wider and Borderless) */
.modal-content {
  border: none !important;
  border-radius: 1.5rem !important;
  box-shadow: 10px 10px 20px #b8b9be, -10px -10px 20px #ffffff !important;
}

.modal-header, .modal-footer {
  border: none !important;
}

@media (min-width: 1200px) {
  .modal-xl {
    max-width: 1140px;
  }
}

/* Force visibility for badges */
.badge-primary {
  background-color: var(--primary) !important;
  color: var(--brand-blue) !important;
  box-shadow: inset 2px 2px 5px #b8b9be, inset -3px -3px 7px #ffffff !important;
  border: 1px solid rgba(13, 40, 79, 0.1) !important;
  font-weight: 700 !important;
}

/* Icon Picker Styles */
.icon-picker-container {
  max-height: 250px;
  overflow-y: auto;
  border-radius: 1rem;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  gap: 10px;
  background-color: var(--primary);
  margin-top: 10px;
}

.icon-option {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  background-color: var(--primary);
  box-shadow: 3px 3px 6px #b8b9be, -3px -3px 7px #ffffff;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  color: var(--brand-blue);
}

.icon-option:hover, .icon-option.active {
  box-shadow: inset 2px 2px 5px #b8b9be, inset -3px -3px 7px #ffffff;
  color: var(--brand-blue);
  background-color: rgba(13, 40, 79, 0.05);
}

.icon-option.active {
  border: 2px solid var(--brand-blue);
}

/* Visual Position Selector */
.position-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 200px;
  margin: 10px 0;
}

.pos-dot {
  width: 100%;
  aspect-ratio: 1/1;
  background-color: var(--primary);
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 6px #b8b9be, -3px -3px 7px #ffffff;
  transition: all 0.2s ease;
}

.pos-dot:hover {
  box-shadow: inset 2px 2px 5px #b8b9be, inset -3px -3px 7px #ffffff;
}

.pos-dot.active {
  background-color: var(--brand-blue);
  color: #fff;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5);
}

/* Hero Caption Positioning Classes */
.pos-top-left { top: 10% !important; left: 5% !important; text-align: left !important; transform: none !important; bottom: auto !important; right: auto !important; }
.pos-top-center { top: 10% !important; left: 50% !important; text-align: center !important; transform: translateX(-50%) !important; bottom: auto !important; max-width: 80% !important; }
.pos-top-right { top: 10% !important; right: 5% !important; left: auto !important; text-align: right !important; transform: none !important; bottom: auto !important; }

.pos-center-left { top: 50% !important; left: 5% !important; text-align: left !important; transform: translateY(-50%) !important; bottom: auto !important; right: auto !important; }
.pos-center-center { top: 50% !important; left: 50% !important; text-align: center !important; transform: translate(-50%, -50%) !important; bottom: auto !important; max-width: 80% !important; }
.pos-center-right { top: 50% !important; right: 5% !important; left: auto !important; text-align: right !important; transform: translateY(-50%) !important; bottom: auto !important; }

.pos-bottom-left { bottom: 10% !important; left: 5% !important; text-align: left !important; transform: none !important; top: auto !important; right: auto !important; }
.pos-bottom-center { bottom: 10% !important; left: 50% !important; text-align: center !important; transform: translateX(-50%) !important; top: auto !important; max-width: 80% !important; }
.pos-bottom-right { bottom: 10% !important; right: 5% !important; left: auto !important; text-align: right !important; transform: none !important; top: auto !important; }

/* Image Normalization */
.img-normalized {
  width: 100%;
  object-fit: cover;
}
.img-ratio-16-9 { aspect-ratio: 16 / 9; }
.img-ratio-4-3 { aspect-ratio: 4 / 3; }
.img-ratio-3-2 { aspect-ratio: 3 / 2; }

/* Admin Gallery Manager (v2.7.0) */
.gallery-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  padding: 1rem;
}

.gallery-item-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 3px 3px 6px #b8b9be, -3px -3px 7px #ffffff;
  cursor: grab;
}

.gallery-item-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.gallery-item-card .item-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item-card:hover .item-actions {
  opacity: 1;
}

.dropzone-custom {
  border: 3px dashed #b8b9be !important;
  background: var(--primary) !important;
  border-radius: 1.5rem !important;
  box-shadow: inset 3px 3px 6px #b8b9be, inset -3px -3px 7px #ffffff !important;
  color: var(--brand-gray) !important;
  padding: 2rem !important;
  text-align: center;
}

/* Cinematic Lightbox (Corrected Centering) */
.lightbox-custom-modal.modal {
  padding: 0 !important;
}

.lightbox-custom-modal .modal-dialog {
  max-width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.lightbox-custom-modal .modal-content {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 100% !important;
  height: 100% !important;
}

.lightbox-backdrop-custom {
  background-color: rgba(0, 0, 0, 0.94) !important;
  backdrop-filter: blur(10px);
}

.lightbox-image-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  height: 100vh;
}

.lightbox-image-container img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 0 50px rgba(0,0,0,0.9);
  border-radius: 0.5rem;
}

.lightbox-close {
  position: fixed;
  top: 25px;
  right: 35px;
  z-index: 2050;
  font-size: 3rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.carousel-control-prev, .carousel-control-next {
  width: 10vw;
  z-index: 2040;
}

.carousel-control-prev-icon, .carousel-control-next-icon {
  width: 4rem;
  height: 4rem;
}

/* Rich Text Content Styling */
.service-content, .project-content, .about-content {
  line-height: 1.8;
  color: var(--brand-blue);
}

.service-content img, .project-content img, .about-content img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 1.5rem 0;
  box-shadow: 3px 3px 6px #b8b9be, -3px -3px 7px #ffffff;
}

/* Icon Shapes */
.icon-shape {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: inset 2px 2px 5px #b8b9be, inset -3px -3px 7px #ffffff;
}

.icon-shape-primary {
  color: var(--brand-blue);
  font-size: 1.25rem;
}

/* Container Refinements (Reduced horizontal padding by ~30% for desktop) */
.container {
  max-width: 1240px; /* Slightly wider than default bootstrap 1140px to compensate */
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* Restore padding for mobile to avoid text touching edges */
@media (max-width: 767.98px) {
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1300px;
  }
}

.section-lg {
  padding-top: 4rem !important;
  padding-bottom: 4rem !important;
}

/* Responsive Fixes */
@media (max-width: 991.98px) {
  .admin-shell { display: block; }
  .admin-sidebar { height: auto; position: relative; width: 100%; }
}

main{
  margin-top: 50px;
}