@font-face {
  font-family: "Nexa";
  src: url("/static/assets/font/nexa/Nexa-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: "Nexa";
  src: url("/static/assets/font/nexa/Nexa-Bold.woff2") format("woff2");
  font-weight: bold;
  font-style: normal;
}

:root {
  --dark-blue: #144a78;
  --dark-green: #007533;
  --green: #75b82b;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --gray: #6c757d;
  --error: #dc3545;
  --success: #28a745;
  --border: rgba(20, 74, 120, 0.12);
  --surface: #ffffff;
  --surface-muted: #eef3f6;
  --shadow: 0 12px 30px rgba(20, 74, 120, 0.1);
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: "Nexa", "Nunito", sans-serif;
  background-color: var(--light-gray);
  color: #333;
}

/* Background for auth pages */
body.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(135deg, rgba(20, 74, 120, 0.92), rgba(0, 117, 51, 0.72)),
    url("/static/assets/images/bg.avif") center / cover no-repeat fixed;
  color: var(--white);
  overflow-y: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--dark-green);
}

/* Buttons */
.btn-primary, .btn-success, .btn-green, .aigleTechButton, #download-selected, .platform_buttons {
  background-color: var(--green) !important;
  border-color: var(--green) !important;
  color: var(--white) !important;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary:hover, .btn-success:hover, .btn-green:hover, .aigleTechButton:hover, #download-selected:hover, .platform_buttons:hover {
  background-color: var(--dark-green) !important;
  border-color: var(--dark-green) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Main Layout Wrapper */
#wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar Styling */
#sidebar-wrapper {
  width: 280px;
  height: 100vh;
  background-color: var(--white);
  border-right: 1px solid rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: margin 0.25s ease-out, transform 0.25s ease-out;
  z-index: 1000;
  margin-left: 0;
}

body.sb-sidenav-toggled #sidebar-wrapper {
  margin-left: -280px;
}

#sidebar-wrapper .sidebar-heading {
  height: 70px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--white);
  background-color: var(--dark-blue);
  font-weight: 800;
  letter-spacing: 0.5px;
}

#sidebar-wrapper .list-group {
  padding: 1rem 0;
  flex-grow: 1;
  overflow-y: auto;
}

#sidebar-wrapper .list-group-item {
  padding: 1rem 1.5rem;
  border: none;
  color: var(--dark-blue);
  font-weight: 600;
  font-size: 0.95rem;
  background: transparent;
  display: flex;
  align-items: center;
  transition: var(--transition);
  border-left: 4px solid transparent;
}

#sidebar-wrapper .list-group-item i {
  width: 24px;
  font-size: 1.1rem;
  margin-right: 0.75rem;
  text-align: center;
}

#sidebar-wrapper .list-group-item:hover,
#sidebar-wrapper .list-group-item.active {
  background-color: rgba(117, 184, 43, 0.08);
  color: var(--green);
  border-left-color: var(--green);
}

/* Page Content Wrapper */
#page-content-wrapper {
  flex: 1;
  min-width: 0;
  background-color: var(--light-gray);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.platform_section {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem !important;
  min-height: 0;
}

/* Navbar Refining */
.navbar {
  height: 70px;
  background-color: var(--white) !important;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 0 1.5rem;
  z-index: 10;
  flex-shrink: 0;
}

.navbar-brand-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-left: 1rem;
}

.navbar-brand-text strong {
  color: var(--green);
}

#sidebarToggle {
  padding: 0.5rem;
  color: var(--dark-blue);
  transition: var(--transition);
}

#sidebarToggle:hover {
  background-color: var(--light-gray);
  border-radius: 50%;
}

/* Sidebar Footer (Powered By) */
.powered-by {
  padding: 1rem;
  border-top: 1px solid rgba(0,0,0,0.05);
  background-color: var(--white);
  text-align: center;
  flex-shrink: 0;
}

.powered-by small {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gray);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 1px;
}

/* Selection Cards (Emails/Dates/Farms/Fields) */
.selection-card {
  max-width: 800px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important;
}

.selection-card .list-group-item {
  padding: 1.1rem 1.5rem;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  font-weight: 500;
  transition: var(--transition);
}

.selection-card .list-group-item:last-child {
  border-bottom: none;
}

.selection-card .list-group-item:hover {
  background-color: var(--light-gray);
  color: var(--green);
  padding-left: 1.75rem;
}

/* Images Grid */
.storage_images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 24px;
  padding: 0;
}

.image-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  background: var(--white);
  aspect-ratio: 4 / 3;
  height: auto;
}

.selection-card {
  max-width: 900px;
  margin: 0 auto;
}

#gorsel-sayisi {
  font-size: 0.9rem;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  vertical-align: middle;
}

#sidebarToggle {
  border-radius: 8px;
  background: var(--light-gray) !important;
  border: 1px solid rgba(0,0,0,0.05) !important;
  padding: 0.4rem 0.8rem;
}

.image-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay-icons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay-btn {
  background: rgba(255, 255, 255, 0.9);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--dark-blue);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.overlay-btn:hover {
  background: var(--white);
  color: var(--error);
  transform: scale(1.1);
}

/* Image Preview Popup */
.popup {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(117, 184, 43, 0.12), transparent 34%),
    rgba(3, 16, 28, 0.94);
  z-index: 9999;
  color: var(--white);
  padding: 1.5rem;
  overflow: auto;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s;
}

.popup.show {
  opacity: 1;
  visibility: visible;
}

.popup-dialog {
  width: min(100%, 1440px);
  height: min(calc(100vh - 3rem), 860px);
  height: min(calc(100dvh - 3rem), 860px);
  min-height: 620px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.4);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.24s ease;
  backdrop-filter: blur(18px);
}

.popup.show .popup-dialog {
  transform: translateY(0) scale(1);
}

.popup-topbar {
  min-height: 76px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(5, 21, 36, 0.72);
}

.popup-kicker {
  color: rgba(255, 255, 255, 0.56);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.popup-topbar h3 {
  margin: 0.2rem 0 0;
  color: var(--white);
  font-size: 1.25rem;
}

.popup .close {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  transition: var(--transition);
  display: inline-grid;
  place-items: center;
}

.popup .close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.popup-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  background: rgba(1, 9, 16, 0.58);
}

.popup-media-panel {
  min-width: 0;
  min-height: 0;
  padding: 1.25rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    rgba(0, 0, 0, 0.18);
}

.popup-image {
  align-self: center;
  justify-self: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

.popup-media-actions {
  display: flex;
  justify-content: center;
}

.popup-side-panel {
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.popup-detail-section {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 1rem;
}

.popup-detail-section h4 {
  margin: 0 0 1rem;
  color: var(--white);
  font-size: 1rem;
}

.popup-section-title h4 {
  margin-bottom: 0.85rem;
}

.popup-detail-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-detail-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.popup-detail-item:last-child {
  padding-bottom: 0;
}

.popup-detail-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(117, 184, 43, 0.16);
  color: var(--green);
  display: inline-grid;
  place-items: center;
}

.popup-detail-item small {
  color: rgba(255, 255, 255, 0.58);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.popup-detail-item strong {
  color: var(--white);
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.popup-map-section {
  flex: 1;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.popup .navigation {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  right: 1.5rem;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10001;
}

.popup .navigation span {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  transition: var(--transition);
  font-size: 1.1rem;
}

.popup .navigation span:hover {
  background: var(--green);
  color: var(--white);
  transform: scale(1.1);
}

#map-container {
  flex: 1;
  min-height: 260px;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.map-empty-state {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 0.65rem;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
}

.map-empty-state i {
  color: var(--green);
  font-size: 1.6rem;
}

#map-container.is-empty #map {
  display: none;
}

#map-container.is-empty .map-empty-state {
  display: grid;
}

/* Pagination */
#sayfalama {
  background: var(--white);
  padding: 1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Loader */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

#preloader {
  width: 100px;
  height: 100px;
  background: url(/static/assets/images/MAY_AigleTech_Orjinal.png) no-repeat center;
  background-size: contain;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Responsive */
.list-group-item-action {
  cursor: pointer;
  transition: all 0.2s ease;
}

.list-group-item-action:hover {
  background-color: #f1f3f5 !important;
  transform: translateX(5px);
}

/* AI Models Section Styling - Full Screen Compact */
#root {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

.App {
  width: 100%;
  max-width: 1300px;
  min-height: 0;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  background: var(--white);
  padding: 1.5rem 2.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  position: relative;
  --ai-app-padding-y: 1.5rem;
  --ai-stage-width: 100%;
  --ai-stage-height: min(58vh, 560px);
}

/* Hide broken image icon robustly */
.App .content img[src="#"],
.App .content img[src=""],
.App .content img:not([src]),
.App img:not([src]), .App img[src=""], .App img[src*="undefined"] {
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute;
}

.App .select {
  width: 100%;
  max-width: 500px;
  margin-bottom: 0.25rem;
}

.App .select select {
  width: 100%;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  border: 2px solid #e9ecef;
  background-color: #f8f9fa;
  color: var(--dark-blue);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23144a78' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.App .select select:hover {
  border-color: var(--green);
}

.App button {
  min-width: 140px;
  border-radius: 10px !important;
  font-size: 0.9rem !important;
  padding: 0.6rem 1.2rem !important;
  transition: var(--transition);
  font-weight: bold;
}

.App button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
  pointer-events: none;
}

/* Styling for the three action buttons */
.App button:not(.btn-primary) {
  background-color: var(--white) !important;
  color: var(--dark-blue) !important;
  border: 2px solid #e9ecef !important;
  margin: 0 0.5rem;
}

.App button:not(.btn-primary):hover {
  border-color: var(--green) !important;
  color: var(--green) !important;
  background-color: rgba(117, 184, 43, 0.05) !important;
}

.content {
  width: var(--ai-stage-width);
  height: var(--ai-stage-height);
  max-width: 100%;
  flex: 0 0 var(--ai-stage-height);
  min-height: var(--ai-stage-height);
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
}

.content.content-empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.App.is-model-loading .content {
  display: flex;
  width: var(--ai-stage-width);
  height: var(--ai-stage-height);
  background: #f8fafc;
  border: 1px solid var(--border);
  box-shadow: none;
  pointer-events: none;
}

.App.is-model-loading .control,
.App.is-model-loading .video_buttons {
  opacity: 0.55;
  pointer-events: none;
}

.App > .wrapper {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  width: var(--ai-stage-width);
  height: var(--ai-stage-height);
  max-width: calc(100% - 5rem);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  border: 1px solid rgba(20, 74, 120, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--dark-blue);
  pointer-events: all;
  transform: translateX(-50%);
}

.App > .wrapper .spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(20, 74, 120, 0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.App > .wrapper p {
  margin: 0;
  color: var(--dark-blue);
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.content img,
.content video,
.content canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: fill;
}

.content video:not([src]) {
  display: none;
}

.content canvas {
  pointer-events: none;
}

#mesaj_veri {
  position: absolute;
  top: calc(var(--ai-app-padding-y) + var(--ai-stage-height) - 4.5rem);
  left: 50%;
  z-index: 18;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: fit-content;
  max-width: min(calc(var(--ai-stage-width) - 2rem), calc(100% - 4rem));
  min-height: 48px;
  margin: 0;
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(5, 25, 45, 0.24);
  color: var(--dark-blue);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

#mesaj_veri:empty {
  display: none !important;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

#mesaj_veri::before {
  content: "\f058";
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(20, 74, 120, 0.08);
  color: var(--dark-blue);
  font-family: "Font Awesome 6 Free";
  font-size: 1rem;
  font-weight: 900;
}

#mesaj_veri:empty::before {
  content: none;
}

#mesaj_veri .save-status-content {
  display: grid;
  min-width: 0;
  text-align: left;
}

#mesaj_veri .save-status-main {
  color: inherit;
  font-size: 0.98rem;
  font-weight: 900;
}

#mesaj_veri .save-status-main strong {
  font-size: 1.14rem;
}

#mesaj_veri.veri_yuklendi {
  border-color: rgba(117, 184, 43, 0.42);
  background: rgba(244, 252, 238, 0.96);
  color: var(--dark-green);
}

#mesaj_veri.veri_yuklendi::before {
  background: var(--green);
  color: var(--white);
}

#mesaj_veri.veri_hata {
  border-color: rgba(220, 53, 69, 0.38);
  background: rgba(255, 244, 244, 0.96);
  color: var(--error);
}

#mesaj_veri.veri_hata::before {
  content: "\f071";
  background: var(--error);
  color: var(--white);
}

.login-container {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem; /* Increased padding */
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.96);
  color: #1f2d3d;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(3, 26, 47, 0.28);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.login-card img {
  width: min(220px, 78%);
  height: auto;
  margin-bottom: 1.5rem;
}

.login-card h1,
.login-card h3 {
  color: var(--dark-blue);
  letter-spacing: 0;
  margin-bottom: 1rem;
}

.login-card p {
  color: #34495e;
}

.auth-form .inputs {
  display: grid;
  gap: 0.75rem;
}

.auth-form input,
.auth-form .form-control {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7dee6;
  border-radius: 8px;
  color: #25313f;
  background: #f8fafc;
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-form input:focus,
.auth-form .form-control:focus {
  background: var(--white);
  border-color: var(--green);
  box-shadow: 0 0 0 0.2rem rgba(117, 184, 43, 0.16);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.8rem;
}

.password-wrapper .icon {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  color: var(--gray);
  cursor: pointer;
  line-height: 1;
}

.warning-message {
  display: none;
  color: var(--error) !important;
  font-size: 0.82rem;
  font-weight: 700;
  margin: -0.35rem 0 0;
  text-align: left;
}

input.invalid {
  border-color: var(--error) !important;
  background: #fff7f7 !important;
}

/* Checkbox styling */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  margin-top: 0.5rem;
}

.form-check-input {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.form-check-label {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #34495e;
  cursor: pointer;
  font-weight: 600;
}

.form-check-label a {
  color: var(--dark-blue);
  text-decoration: underline;
  font-weight: 700;
}

.platform_section--ai {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-heading {
  width: min(100%, 1180px);
  margin: 0 auto 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading h1 {
  margin: 0;
  color: var(--dark-blue);
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
}

.page-heading p {
  margin: 0.35rem 0 0;
  color: var(--gray);
}

.date-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 0 1 420px;
  min-width: min(100%, 420px);
}

.date-heading-actions .form-select {
  min-width: 150px;
  border-color: var(--border);
  color: var(--dark-blue);
  font-weight: 800;
}

.date-heading-actions #year-selector {
  min-width: 110px;
}

.date-heading-actions #month-selector {
  min-width: 170px;
}

.date-browser {
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.month-panel,
.date-results {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(20, 74, 120, 0.06);
}

.month-panel {
  position: sticky;
  top: 1rem;
  overflow: hidden;
}

.month-panel-header,
.date-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.month-panel-header span,
.date-results-header h2 {
  color: var(--dark-blue);
  font-weight: 800;
}

.month-panel-header small,
.date-results-header p {
  color: var(--gray);
  margin: 0;
}

.month-list {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.month-filter {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dark-blue);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  transition: var(--transition);
}

.month-filter:hover,
.month-filter.active {
  background: rgba(117, 184, 43, 0.1);
  border-color: rgba(117, 184, 43, 0.25);
  color: var(--dark-green);
}

.month-filter span {
  font-weight: 800;
}

.month-filter small {
  color: var(--gray);
  white-space: nowrap;
}

.date-results {
  min-height: 420px;
}

.date-results-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.date-list {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.date-result-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid rgba(20, 74, 120, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.date-card-calendar {
  min-height: 84px;
  border-radius: 8px;
  background: rgba(20, 74, 120, 0.08);
  color: var(--dark-blue);
  display: grid;
  place-items: center;
  align-content: center;
}

.date-card-day {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
}

.date-card-month {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.date-card-content h3 {
  margin: 0;
  color: var(--dark-blue);
  font-size: 1.05rem;
}

.date-card-content p {
  margin: 0.25rem 0 0.75rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.date-model-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.empty-state {
  color: var(--gray);
  padding: 1rem;
  text-align: center;
}

.gallery-toolbar {
  align-items: flex-start !important;
}

.gallery-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.back-to-dates {
  border-color: var(--border) !important;
  color: var(--dark-blue) !important;
  background: var(--white) !important;
  font-weight: 800;
}

.gallery-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gallery-map-card {
  overflow: hidden;
}

.map-card,
.profile-card,
.upload-card {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
}

#newMap {
  width: 100%;
  height: min(42vh, 420px);
  min-height: 300px;
}

.map-dot-marker {
  width: 14px;
  height: 14px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: #e03131;
  box-shadow:
    0 0 0 5px rgba(224, 49, 49, 0.22),
    0 6px 14px rgba(0, 0, 0, 0.35);
  display: block;
}

.map-dot-marker--cluster {
  width: auto;
  min-width: 32px;
  height: 32px;
  padding: 0 0.45rem;
  border-width: 2px;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 0 0 7px rgba(224, 49, 49, 0.2),
    0 8px 18px rgba(0, 0, 0, 0.38);
}

.map-cluster-picker {
  width: min(280px, 72vw);
  color: #243447;
  font-family: "Nexa", "Nunito", sans-serif;
}

.map-cluster-picker-header {
  display: grid;
  gap: 0.15rem;
  padding: 0 0 0.65rem;
  border-bottom: 1px solid rgba(20, 74, 120, 0.12);
}

.map-cluster-picker-header strong {
  color: var(--dark-blue);
  font-size: 0.95rem;
  font-weight: 900;
}

.map-cluster-picker-header span {
  color: var(--gray);
  font-size: 0.78rem;
  font-weight: 700;
}

.map-cluster-picker-list {
  display: grid;
  gap: 0.45rem;
  max-height: 280px;
  overflow-y: auto;
  padding-top: 0.65rem;
}

.map-cluster-picker-item {
  width: 100%;
  border: 1px solid rgba(20, 74, 120, 0.1);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem;
  text-align: left;
  transition: var(--transition);
}

.map-cluster-picker-item:hover {
  border-color: rgba(224, 49, 49, 0.35);
  background: #fff7f7;
}

.map-cluster-picker-thumb {
  width: 48px;
  height: 48px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-muted);
}

.map-cluster-picker-meta {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.map-cluster-picker-meta strong {
  color: var(--dark-blue);
  font-size: 0.86rem;
  font-weight: 900;
}

.map-cluster-picker-meta small {
  color: var(--gray);
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-box {
  border-radius: 8px !important;
}

.image-box img {
  display: block;
}

.thumbnail[data-src] {
  opacity: 0;
}

.thumbnail-container {
  background:
    linear-gradient(135deg, rgba(20, 74, 120, 0.08), rgba(117, 184, 43, 0.12)),
    var(--surface-muted);
}

.selection-modal-toolbar {
  gap: 0.75rem;
}

.upload-progress {
  height: 10px;
}

.tum_veri_yuklendi {
  color: var(--success) !important;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .popup {
    align-items: flex-start;
  }

  .popup-dialog {
    height: auto !important;
    min-height: auto;
  }

  .popup-body {
    grid-template-columns: 1fr;
  }

  .popup-media-panel {
    min-height: 52vh;
  }

  .popup-side-panel {
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    max-height: none;
  }

  .popup-map-section {
    min-height: 260px;
  }

  #map-container {
    min-height: 260px;
  }
}

@media (max-width: 768px) {
  .popup {
    padding: 0.75rem;
  }

  .popup-topbar {
    min-height: auto;
    padding: 0.85rem;
  }

  .popup-topbar h3 {
    font-size: 1.05rem;
  }

  body:not(.auth-page)::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(13, 34, 52, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 998;
  }

  body.sb-sidenav-toggled:not(.auth-page)::before {
    opacity: 1;
    pointer-events: auto;
  }

  #sidebar-wrapper {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    height: 100dvh;
    margin-left: 0;
    transform: translateX(-100%);
    box-shadow: 20px 0 45px rgba(20, 74, 120, 0.18);
  }

  body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: 0;
    transform: translateX(0);
  }

  #page-content-wrapper {
    width: 100%;
  }

  .navbar {
    height: auto;
    min-height: 64px;
    padding: 0.6rem 0.85rem;
  }

  .navbar .container-fluid {
    gap: 0.75rem;
    padding: 0;
  }

  .slogan img {
    height: 32px;
  }

  .navbar-brand-text {
    display: none;
  }

  .platform_section {
    padding: 1rem !important;
  }

  .content,
  .App.is-model-loading .content {
    height: var(--ai-stage-height);
  }

  .App > .wrapper {
    top: 1.5rem;
    left: 50%;
    right: auto;
    width: var(--ai-stage-width);
    height: var(--ai-stage-height);
    max-width: calc(100% - 3rem);
  }

  .page-heading {
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .date-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .date-heading-actions .form-select {
    min-width: 0;
    flex: 1;
  }

  .date-browser {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .month-panel {
    position: static;
  }

  .month-list {
    display: flex;
    gap: 0.6rem;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.9rem;
  }

  .month-filter {
    min-width: 190px;
  }

  .date-results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .storage_images {
    gap: 14px;
  }

  .selection-card .list-group-item {
    padding: 0.9rem 1rem;
  }

  #sayfalama {
    padding: 0.75rem;
  }

  #sayfalama .btn {
    width: auto;
  }

  .gallery-actions {
    width: 100%;
    justify-content: space-between;
  }

  .gallery-title {
    width: 100%;
  }

  .selection-modal-toolbar {
    align-items: stretch !important;
    flex-direction: column;
  }

  .selection-modal-toolbar > div,
  .selection-modal-toolbar button {
    width: 100%;
  }

  .selection-modal-toolbar > div {
    display: grid;
    gap: 0.75rem;
  }

  .modal-dialog {
    margin: 0.75rem;
  }

  .App {
    padding: 1rem;
    max-height: none;
    min-height: 70vh;
    --ai-app-padding-y: 1rem;
  }

  .App button {
    width: 100%;
    margin: 0.25rem 0 !important;
  }
}

@media (max-width: 600px) {
  .login-container {
    align-items: flex-start;
    padding-top: 1rem;
  }

  .login-card {
    width: 330px;
    max-width: calc(100vw - 1.5rem);
    padding: 1.25rem;
  }

  .date-result-card {
    grid-template-columns: 1fr;
  }

  .date-card-calendar {
    min-height: 72px;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 0.45rem;
  }

  .date-model-actions .btn {
    width: 100%;
  }

  .popup .close {
    width: 40px;
    height: 40px;
  }

  .popup-kicker {
    font-size: 0.66rem;
  }

  .popup-media-panel,
  .popup-side-panel {
    padding: 0.85rem;
  }

  .popup .navigation {
    left: 0.9rem;
    right: 0.9rem;
  }

  .popup .navigation span {
    width: 44px;
    height: 44px;
  }
}
