@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,300;0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  --primary: #4361ee;
  --secondary: #3a0ca3;
  --success: #4cc9f0;
  --warning: #fbc517;
  --danger: #e63946;
  --light: #f8f9fa;
  --dark: #212529;
  --gray-light: #eef0f3;
  --gray: #adb5bd;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto Condensed', sans-serif;
}

html, body {
  background: #f8f9fa;
  position: relative;
  width: 100%;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

/* Header Styles */
div.header-sticky {
  z-index: 9999;
  position: sticky;
  top: 0;
  padding: 1rem 1.5rem;
  background-color: white;
  border-bottom: 1px solid var(--gray-light);
  box-shadow: var(--box-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  padding-bottom: 0.75rem;
  color: var(--dark);
  font-weight: 700;
}

h2 {
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

h2.alert {
  color: var(--danger);
}

/* Card-like sections */
.h3office, .h3date, .h3map, .h3delivered, .h3rejected, .h3returned {
  font-weight: 500;
  font-size: 1.25rem;
  padding: 1rem 1.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.h3office {
  background-color: var(--warning);
  color: var(--dark);
}

.h3date {
  background-color: var(--warning);
  color: var(--dark);
}

.h3map {
  background-color: var(--warning);
  color: var(--dark);
}

.h3delivered {
  background-color: #aafb9f;
  color: #1a5a1a;
}

.h3delivered::before {
  content: "✔ ";
}

.h3rejected {
  background-color: #fd7676;
  color: #7a0b0b;
}

.h3rejected:before {
  content: "❌ ";
}

.h3returned {
  background-color: #998989;
  color: white;
}

.h3returned::before {
  content: "↩ ";
}

/* Monospaced elements */
div.monospaced {
  font-family: 'JetBrains Mono', monospace;
  border-bottom: 1px dotted var(--gray);
  padding: 1rem 1.5rem;
  display: block;
  opacity: 0.85;
  transition: var(--transition);
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
}

div.monospaced:hover {
  opacity: 1;
  background-color: white;
  box-shadow: var(--box-shadow);
}

div.monospaced:nth-child(odd) {
  background-color: #f9f9f9;
}

div.monospaced:nth-child(even) {
  background-color: var(--gray-light);
}

div.predict {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 1.5rem;
  background-color: var(--warning);
  color: var(--dark);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  box-shadow: var(--box-shadow);
}

span.monoblocked {
  display: block;
  font-family: inherit;
}

span.monoblocked-inline {
  display: inline !important;
  font-family: inherit;
}

span.timestamp {
  font-family: inherit;
  font-weight: 500;
  border-radius: 4px;
  margin: 0 2px 0 0;
  padding: 0.25rem 0.5rem;
  background-color: var(--gray-light);
  color: var(--dark);
}

span.timestamp::after {
  content: " →";
}

span.status {
  font-family: inherit;
}

/* Links */
a {
  font-family: inherit;
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
  color: var(--secondary);
}

strong {
  font-family: inherit;
  font-weight: 700;
}

.pull-right {
  float: right;
}

/* Courier service colors */
.bgpost {
  color: #a3731c;
  font-weight: 600;
}

.emsbulpost {
  color: #0061aa;
  font-weight: 600;
}

.econt {
  color: #4877ce;
  font-weight: 600;
}

.speedy {
  color: #dc0032;
  font-weight: 600;
}

.a1post {
  color: #fba511;
  font-weight: 600;
}

.leoexpres {
  color: #f78721;
  font-weight: 600;
}

.cvc {
  color: #5F3E8F;
  font-weight: 600;
}

.elta {
  color: #0077ba;
  font-weight: 600;
}

/* Review area */
.reviewarea {
  font-size: 1rem;
  padding: 1rem 1.5rem;
  background-color: #fcfff1;
  border-bottom: 1px solid var(--gray);
  flex: 1 1 auto;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  box-shadow: var(--box-shadow);
}

/* Map iframe */
.ifmap {
  width: 100%;
  height: 400px;
  border: 0;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* Utility classes */
.container {
  width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

/* Mobile First Styles */
@media screen and (max-width: 767px) {
  h1.maintitle {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .header-sticky {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  span.optional {
    display: none;
  }

  .container {
    padding: 0 0.5rem;
  }
  
  .h3office, .h3date, .h3map, .h3delivered, .h3rejected, .h3returned {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
  }
}

/* Tablet Styles */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  #main {
    max-width: 90%;
    margin: 1.5rem auto;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    background: white;
    box-shadow: var(--box-shadow);
  }

  h1.maintitle {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .ifmap {
    height: 450px;
  }
}

/* Desktop Styles */
@media screen and (min-width: 1024px) {
  #main {
    max-width: 1000px;
    margin: 2rem auto;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    padding: 2rem;
    background: white;
    box-shadow: var(--box-shadow);
  }

  h1.maintitle {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .ifmap {
    height: 500px;
  }

  .optional {
    display: inline;
  }
}

/* Animation for status changes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.h3delivered, .h3rejected, .h3returned {
  animation: fadeIn 0.5s ease;
}

/* Button styles (if needed later) */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.btn:hover {
  background-color: var(--secondary);
  text-decoration: none;
}

/* --- Стил за Модален Прозорец (вече с нов клас) --- */

/* 1. Затъмненият фон (основният контейнер) */
.delivery-modal {
  display: none; /* Скрит по подразбиране */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(33, 37, 41, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 1rem;
  cursor: pointer;
  animation: fadeInOverlay 0.3s ease-out;
}

/* Всички останали стилове за модалния прозорец остават същите */
.modal-content {
  background-color: white;
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
  max-width: 500px;
  width: 100%;
  animation: zoomInModal 0.4s ease-out forwards;
  transform: scale(0.9);
  cursor: default;
}

.modal-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem auto;
  background-color: #28a745;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
}

.modal-title {
  color: var(--dark);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.modal-content .status-chronology {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  text-align: left;
  line-height: 1.7;
  color: #6c757d;
  background-color: var(--gray-light);
  border-left: 3px solid #28a745;
  padding: 1rem;
  border-radius: 4px;
}

.modal-content .status-chronology strong {
  color: var(--dark);
  font-weight: 500;
}

/* Анимациите остават същите */
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomInModal {
  from { 
    opacity: 0;
    transform: scale(0.85); 
  }
  to { 
    opacity: 1;
    transform: scale(1); 
  }
}
