/*
  =============================================================================
  Bootstrap 5 Replica - Same look & structure as Bootstrap
  Author: Molla Samser | rskworld.in | 2026
  - Website: https://rskworld.in
  No Bootstrap dependency - pure CSS replica for 3D Gallery project.
  =============================================================================
*/

/* ----- Bootstrap 5 CSS Variables (replica) ----- */
:root {
  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;
  --bs-secondary: #6c757d;
  --bs-success: #198754;
  --bs-danger: #dc3545;
  --bs-warning: #ffc107;
  --bs-info: #0dcaf0;
  --bs-light: #f8f9fa;
  --bs-dark: #212529;
  --bs-body-color: #212529;
  --bs-body-bg: #fff;
  --bs-border-color: #dee2e6;
  --bs-border-radius: 0.375rem;
  --bs-border-radius-sm: 0.25rem;
  --bs-border-radius-lg: 0.5rem;
  --bs-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-font-weight: 400;
  --bs-body-line-height: 1.5;
  --bs-link-color: var(--bs-primary);
  --bs-link-hover-color: #0a58ca;
  --bs-navbar-padding-y: 0.5rem;
  --bs-navbar-brand-font-size: 1.25rem;
  --bs-card-border-width: 1px;
  --bs-card-border-radius: 0.375rem;
  --bs-card-cap-bg: rgba(0, 0, 0, 0.03);
  --bs-card-bg: #fff;
}


/* Map to existing vars so 3D styles work */
:root {
  --accent: var(--bs-primary);
  --accent-light: #6ea8fe;
  --accent-dim: rgba(var(--bs-primary-rgb), 0.25);
  --bg-dark: var(--bs-body-bg);
  --bg-card: var(--bs-card-bg);
  --bg-elevated: var(--bs-light);
  --text: var(--bs-body-color);
  --text-muted: var(--bs-secondary);
  --border: var(--bs-border-color);
  --shadow-accent: rgba(var(--bs-primary-rgb), 0.25);
}
[data-theme="dark"] {
  --bs-body-bg: #212529;
  --bs-body-color: #dee2e6;
  --bs-border-color: #495057;
  --bs-card-bg: #343a40;
  --bs-card-cap-bg: rgba(0, 0, 0, 0.2);
  --bg-elevated: #495057;
}

/* ----- Container & Grid (Bootstrap replica) ----- */
.container, .container-fluid {
  width: 100%;
  padding-right: 12px;
  padding-left: 12px;
  margin-right: auto;
  margin-left: auto;
}

.container { max-width: 1320px; }
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left: -12px;
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 12px;
  padding-left: 12px;
  margin-bottom: 1rem;
}

.col-12 { flex: 0 0 auto; width: 100%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-3 { flex: 0 0 auto; width: 25%; }
@media (min-width: 768px) {
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-md-3 { flex: 0 0 auto; width: 25%; }
}
@media (min-width: 992px) {
  .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
}

/* ----- Spacing (Bootstrap py-, my-, etc.) ----- */
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-3 { padding-top: 1rem; }
.pb-3 { padding-bottom: 1rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--bs-secondary); }

/* ----- Navbar (Bootstrap replica) ----- */
.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--bs-navbar-padding-y);
  padding-bottom: var(--bs-navbar-padding-y);
}

.navbar > .container, .navbar > .container-fluid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }

.navbar-brand {
  padding-top: 0.3125rem;
  padding-bottom: 0.3125rem;
  margin-right: 1rem;
  font-size: var(--bs-navbar-brand-font-size);
  text-decoration: none;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.navbar-brand:hover { color: #fff; }

.navbar-nav {
  display: flex;
  flex-direction: row;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-radius: var(--bs-border-radius);
  font-size: 0.9375rem;
  transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover, .nav-link:focus { color: #fff; background-color: rgba(255, 255, 255, 0.1); }
.nav-link.active { color: #fff; background-color: rgba(255, 255, 255, 0.2); }
.navbar-dark .nav-link { color: rgba(255, 255, 255, 0.85); }
.navbar-dark .nav-link:hover { color: #fff; }
.navbar-dark .nav-link.active { color: #fff; }

.navbar-collapse { flex-basis: 100%; flex-grow: 1; align-items: center; }
.navbar-expand-lg .navbar-collapse { display: flex !important; flex-basis: auto; }

/* Navbar light variant */
.navbar-light .navbar-brand { color: var(--bs-dark); }
.navbar-light .navbar-brand:hover { color: var(--bs-dark); }
.navbar-light .nav-link { color: rgba(0, 0, 0, 0.7); }
.navbar-light .nav-link:hover { color: rgba(0, 0, 0, 0.9); background-color: rgba(0, 0, 0, 0.05); }

.bg-primary { background-color: var(--bs-primary) !important; }
.bg-dark { background-color: var(--bs-dark) !important; }
.bg-light { background-color: var(--bs-light) !important; }

/* Navbar container and brand: no white box so "3D Gallery" stays visible on blue */
.navbar.bg-primary .container,
.navbar.bg-primary .container-fluid,
.navbar.bg-primary .navbar-brand,
.navbar.bg-primary .navbar-collapse,
.navbar.bg-primary .navbar-nav {
  background: transparent !important;
  background-color: transparent !important;
}

/* ----- Cards (Bootstrap replica) ----- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: var(--bs-card-bg);
  background-clip: border-box;
  border: var(--bs-card-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-card-border-radius);
  box-shadow: var(--bs-box-shadow);
}

.card-body {
  flex: 1 1 auto;
  padding: 1rem 1rem;
}

.card-header {
  padding: 0.5rem 1rem;
  margin-bottom: 0;
  background-color: var(--bs-card-cap-bg);
  border-bottom: var(--bs-card-border-width) solid var(--bs-border-color);
  border-radius: calc(var(--bs-card-border-radius) - 1px) calc(var(--bs-card-border-radius) - 1px) 0 0;
  font-weight: 600;
  font-size: 1rem;
}

.card-header:first-child { border-radius: var(--bs-card-border-radius) var(--bs-card-border-radius) 0 0; }

.card-title { margin-bottom: 0.5rem; font-size: 1.1rem; font-weight: 600; }
.card-text { margin-bottom: 0.5rem; font-size: 0.9375rem; color: var(--bs-secondary); }

/* ----- Buttons (Bootstrap replica) ----- */
.btn {
  display: inline-block;
  font-weight: 500;
  line-height: 1.5;
  color: var(--bs-body-color);
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  border-radius: var(--bs-border-radius);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-primary:hover {
  color: #fff;
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-outline-primary {
  color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-outline-secondary {
  color: var(--bs-secondary);
  border-color: var(--bs-secondary);
}

.btn-outline-secondary:hover {
  color: #fff;
  background-color: var(--bs-secondary);
  border-color: var(--bs-secondary);
}

.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.875rem; border-radius: var(--bs-border-radius-sm); }

/* ----- Jumbotron / Hero (Bootstrap-style) ----- */
.jumbotron, .bg-light.p-5.rounded {
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  background-color: var(--bs-light);
  border-radius: var(--bs-border-radius-lg);
}

[data-theme="dark"] .jumbotron, [data-theme="dark"] .bg-light.p-5.rounded { background-color: rgba(255,255,255,0.05); }

.display-5 { font-size: calc(1.425rem + 2.1vw); font-weight: 300; line-height: 1.2; }
@media (min-width: 1200px) { .display-5 { font-size: 2.5rem; } }

.lead { font-size: 1.25rem; font-weight: 300; }

/* ----- Footer (Bootstrap-style) ----- */
.footer-replica {
  padding: 2rem 0;
  color: var(--bs-secondary);
  background-color: var(--bs-light);
  border-top: 1px solid var(--bs-border-color);
}

[data-theme="dark"] .footer-replica { background-color: rgba(0,0,0,0.2); border-color: var(--bs-border-color); }

.footer-replica a { color: var(--bs-primary); text-decoration: none; }
.footer-replica a:hover { text-decoration: underline; }

/* ----- Utilities ----- */
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.w-100 { width: 100%; }
.ms-auto { margin-left: auto; }
.btn-outline-light { color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover { color: var(--bs-dark); background-color: #fff; border-color: #fff; }

/* ----- Override gallery layout to use Bootstrap container ----- */
.gallery-container { max-width: 100%; padding-left: 12px; padding-right: 12px; }
.gallery-section.card { margin-bottom: 1.5rem; }
.gallery-header.jumbotron-style {
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
  background-color: #0d6efd !important;
  color: #fff !important;
  border-radius: var(--bs-border-radius-lg);
  border-bottom: none !important;
}
/* Remove white box: container inside header must be transparent */
.gallery-header.jumbotron-style .container {
  background: transparent !important;
  background-color: transparent !important;
}
.gallery-header.jumbotron-style h1 { color: #fff !important; background: none !important; -webkit-background-clip: unset !important; -webkit-text-fill-color: #fff !important; background-clip: unset !important; }
.gallery-header.jumbotron-style p { color: rgba(255,255,255,0.95) !important; }
.gallery-header.jumbotron-style .credit a { color: rgba(255,255,255,0.95) !important; }
.gallery-header.jumbotron-style a { color: rgba(255,255,255,0.95); }
.gallery-header.jumbotron-style a:hover { color: #fff; }
