/*
Light blue (#E9F1FA) mainostilat
Soft neutral #F8F8F5 sivun tausta
*/


body {
    background-color: #F8F8F5;
    color: black;
    margin: 0; 
}

/* Navbar styling moved from base.html */
.site-header {
  background-color: #000; /* full-width black header background */
}

.site-navbar {
  background-color: #000; /* match header */
  position: sticky;
  top: 0;
  z-index: 1030; /* above content */
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075); /* shadow-sm equivalent */
}

/* Ensure unread badge aligns nicely in navbar */
#unread-badge { line-height: 1; }

.logo {
    margin-bottom: 20px;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
}


/* Tämä on jo hyvää, content-wrapperin avulla keskitetään sisältö */
.content-wrapper {
    max-width: 1000px; /* Voit muuttaa tämän haluamaksesi leveysrajaksi */
    padding: 20px;  /*  Hyvä olla paddingia reunoilla */
    margin: 0 auto;  /* Tämä keskittää */
}

footer {
    background-color: #000000;
    color: white;
    padding: 20px 0; /* Ylä- ja alamarginaali */
    margin-top: auto; /*Työntää footerin alas*/
}

.footer-links {
    margin-top: 10px;  /* Pieni marginaali yläpuolelle */
}

.footer-links a {
    color: lightgray;
    text-decoration: none;
    margin: 0 10px;
}

/* .table img on korvattu tällä: */
.bike-image {
    max-width: 100%;  
    height: auto;      
}

.no-image-icon {
    font-size: 2rem;
    color: gray;
    display: block;
    text-align: center;
    margin-top: 10px;
}

.image-upload-box {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.image-upload-box:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


.bike-card .card-text {
    margin-bottom: 3px;
}

/* Subtle 3D base shadow for bike cards */
.bike-card {
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.06s ease;
  border: 1px solid #e9ecef;
  /* Stronger 3D: inner highlights + right/bottom edges + ambient */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),   /* top highlight */
    inset 1px 0 0 rgba(255, 255, 255, 0.75),   /* left highlight */
    2px 0 0 rgba(0, 0, 0, 0.10),               /* right edge */
    0 2px 0 rgba(0, 0, 0, 0.12),               /* bottom edge */
    10px 12px 24px rgba(0, 0, 0, 0.16);        /* ambient drop */
}
.bike-card:hover {
  background-color: #f8f9fa;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.90),   /* brighter top highlight */
    inset 1px 0 0 rgba(255, 255, 255, 0.80),   /* brighter left highlight */
    3px 0 0 rgba(0, 0, 0, 0.14),               /* stronger right edge */
    0 3px 0 rgba(0, 0, 0, 0.16),               /* stronger bottom edge */
    14px 16px 28px rgba(0, 0, 0, 0.20);        /* deeper ambient */
}
.bike-card:active { transform: translateY(1px); }

.stolen_bike-card {
    background-color: #fff9c4;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.06s ease;
    border: 1px solid #e9ecef;
    /* Stronger 3D for stolen card */
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.85),
      inset 1px 0 0 rgba(255, 255, 255, 0.75),
      2px 0 0 rgba(0, 0, 0, 0.10),
      0 2px 0 rgba(0, 0, 0, 0.12),
      10px 12px 24px rgba(0, 0, 0, 0.16);
}
.stolen_bike-card .card-text {
    margin-bottom: 3px;
}
.stolen_bike-card:hover {
    background-color: #fff59d;
    cursor: pointer;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.90),
      inset 1px 0 0 rgba(255, 255, 255, 0.80),
      3px 0 0 rgba(0, 0, 0, 0.14),
      0 3px 0 rgba(0, 0, 0, 0.16),
      14px 16px 28px rgba(0, 0, 0, 0.20);
}

.page-action-buttons {
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  .page-action-buttons .btn {
    min-width: 120px;
  }

.chat-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    margin-top: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

#messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    padding: 10px;
}

#messages li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    width: 100%;
}

#messages li:last-child {
    border-bottom: none;
}

#chatForm {
    display: flex;
    gap: 10px;
}

#chatInput {
    flex-grow: 1;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

#chatForm button {
    padding: 10px 20px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

#chatForm button:hover {
    background: #0056b3;
}

.message-timestamp {
    display: block;
    font-size: 0.8rem;
    color: rgb(6, 6, 6);
    margin-top: 5px;
}

.message {
    display: inline-block;
    width: fit-content;
    max-width: 70%;
    min-width: 40px;
    padding: 10px;
    border-radius: 10px;
    margin: 5px 0;
    position: relative;
    word-wrap: break-word;
    word-break: break-word;
    clear: both;
}

.message-left {
    background-color: #e9ecef;
    align-self: flex-start;
}

.message-right {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
}

/* Korostus ja hover-efekti käyttäjätaulukon riveille */
.user-row:hover {
    cursor: pointer;
    background-color: #f1f1f1;
}

.user-row.selected-row {
    background-color: #d1e7fd;
}

.table tbody .user-row.selected-row td {
    background-color: #d1e7fd !important;
}

.ad-card .card-text {
    margin-bottom: 3px;
}

.ad-card {
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.06s ease;
  border: 1px solid #e9ecef;
  /* Stronger 3D for ads, but slightly subtler than bikes */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 1px 0 0 rgba(255, 255, 255, 0.75),
    2px 0 0 rgba(0, 0, 0, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.10),
    10px 12px 24px rgba(0, 0, 0, 0.14);
}
.ad-card:hover {
  background-color: #f8f9fa;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.90),
    inset 1px 0 0 rgba(255, 255, 255, 0.80),
    3px 0 0 rgba(0, 0, 0, 0.10),
    0 3px 0 rgba(0, 0, 0, 0.14),
    14px 16px 28px rgba(0, 0, 0, 0.18);
}
.ad-card:active { transform: translateY(1px); }

.ad-card img {
    max-width: 100%;  
    height: auto;
}

.col-xl-1-5 {
  flex: 0 0 auto;
  width: 12.5%;
}

.ad-section-heading-top {
    background-color: black;
    color: white;
    padding: 10px;
    border-radius: 4px;
}

.ad-section-heading-bottom {
    background-color: black;
    color: white;
    padding: 10px;
    border-radius: 4px;

}

.ad-space-header,
.ad-space-footer {
    background-color: #E9F1FA;
    padding: 2rem 1rem;
    border-radius: 6px;
}
.ad-card-small {
    font-size: 0.875rem;
    height: 100%;
    max-height: 300px;
}

/* Merged .ad-card-img definitions, keeping width:100%; height:180px; object-fit: contain; */
/* Commented out the conflicting width:auto version below */
.ad-card-img {
  max-height: 180px;
  width: 100%;
  height: 180px; /* ensures consistent card heights */
  object-fit: contain;
}
/*
.ad-card-img {
  max-height: 180px;
  width: auto;
  object-fit: contain;
}
*/

.ad-card-small .card-img-top {
    max-height: 90px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.ad-card-small .card-body {
    padding: 0.5rem;
}

.ad-banner-bg {
    aspect-ratio: 6 / 1;
    background-color: black;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    position: relative;
    margin: 1rem 0;
    width: 100%;
    overflow: hidden;
}

/* Commented out second .ad-banner-bg occurrence to avoid conflict */
/*
.ad-banner-bg {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  height: 250px;
  position: relative;
}
*/

.banner-link {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 1;
}
.site-navbar .nav-item {
    display: flex;
    align-items: center;
}
.site-navbar .nav-link {
    color: white;
    padding: 0.5rem 1rem;
    transition: color 0.3s, background-color 0.3s;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    display: block;
}
.site-navbar .nav-link:hover, .site-navbar .nav-link:focus {
    background-color: rgba(255,255,255,0.1);
    color: #7e8fe9;
    text-decoration: none;
}
.site-navbar .nav-item.active .nav-link,
.site-navbar .nav-link.active {
    font-weight: bold;
    border-bottom: 2px solid #ffcc00;
    color: #ffcc00;
    background-color: rgba(255,255,255,0.08);
}

/* ==== CSP-safe replacements for former inline styles from base.html ==== */

/* Hide element (badge) when unread count is zero */
.is-hidden {
  display: none !important;
}

/* Header banner image replaced from background-image to <img> */
.ad-banner-img {
  width: 100%;
  height: 100%; /* fill the aspect-ratio container */
  object-fit: contain; /* show full image without cropping */
  display: block;
}

/* Small ad card image constraints (duplicate of merged .ad-card-img above) */
/*
.ad-card-img {
  max-height: 180px;
  width: 100%;
  height: 180px; 
  object-fit: contain;
}
*/

/* Banner preview image styles moved from template create_ad (CSP-safe) */
.banner-preview {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  background-color: #000; /* mustat reunat jos ei täytä koko tilaa */
  display: block;
  margin: 0 auto;
}

.img-thumb-120 {
  width: 120px;
  height: 120px;
  object-fit: cover;
}

/* 150x150 kuvagallerialle */
.img-thumb-150 {
  width: 150px;
  height: 150px;
  object-fit: cover;
}

/* chat-näkymä: pikkukuva */
.img-max-120 { max-width: 120px; }

/* kapea ilmoitusboksi */
.alert-narrow { max-width: 400px; }

/* chat-lista: pikkukuva */
.img-max-100 { max-width: 100px; }

/* forgot_password */
.max-width-500 { max-width: 500px; }

/* Unified logo-small height to 2rem */
/* .logo-small {
  height: 2.5em;
} */
.logo-small {
  height: 2rem;
}

/* === Mobile-friendly select sizing (only where class is used) === */
.form-select-mobile {
  font-size: 16px;              /* estää iOS-autozoomin ja parantaa luettavuutta */
}
@media (max-width: 576px) {
  .form-select-mobile {
    font-size: 16px;            /* pidä luettavana pienissä näytöissä */
    line-height: 1.4;
    padding: 0.6rem 0.75rem;    /* isompi kosketuspinta */
    min-height: 44px;           /* WCAG-suositus tap-targetille */
  }
  .form-select-mobile option {
    font-size: 16px;            /* Android kunnioittaa usein tätä valikossa */
  }
}

/* Stronger specificity for Bootstrap selects */
.form-select.form-select-mobile,
select.form-select-mobile {
  font-size: 16px;
}
@media (max-width: 576px) {
  .form-select.form-select-mobile,
  select.form-select-mobile {
    font-size: 16px;
    line-height: 1.4;
    padding: 0.6rem 0.75rem;
    min-height: 44px;
  }
  .form-select-mobile option { font-size: 16px; }
}

/* === Info icon button (popover trigger) === */
.info-icon-btn {
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 0; /* poistaa extra-välit inline-elementeiltä */
  margin-left: 0.5rem;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #e9ecef;   /* harmaa tausta (Bootstrap gray-200) */
  color: #6c757d;              /* i-kirjaimen väri (gray-600) */
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #fff;      /* valkoinen ohut kehä, “häviää” vaaleaan taustaan */
}

.info-icon-btn:hover .info-icon,
.info-icon-btn:focus .info-icon {
  background-color: #dee2e6;   /* aavistus tummempi hover/focus */
  outline: none;
}

/* Huoltolinkin esitys pelkkänä tekstinä modalissa */
.token-plain-link {
  word-break: break-all;            /* rivitä pitkät URL:t modalin sisään */
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  margin: 0;
}
.token-plain-link:focus { outline: none; }

/* Korosta linkkitekstin valinta selkeästi */
.token-plain-link::selection {
  background: #cfe2ff; /* vaalea sininen */
  color: inherit;
}
/* Varmuuskopiot eri moottoreille */
.token-plain-link::-moz-selection { background: #cfe2ff; color: inherit; }
.token-plain-link::-webkit-selection { background: #cfe2ff; color: inherit; }

.chat-textarea {
  resize: none;           /* käyttäjä ei venytä käsin */
  min-height: 40px;       /* aloituskorkeus */
  line-height: 1.375;     /* sopivan tiivis riviväli */
}
#message-form .btn {
  align-self: flex-end;   /* nappi pohjaan kun textarea kasvaa */
}
# ===== Front page cards (buttons) =====
.front-page-grid { /* placeholder for possible future custom spacing/width rules */ }

.front-page-card {
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.06s ease;
  border: 1px solid #E6EEF7;           /* soft cool border */
  background-color: #F2F7FB;           /* soft cool card background */
  /* Stronger 3D: inner light on top/left + deeper right/bottom shadow */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),   /* top highlight */
    inset 1px 0 0 rgba(255, 255, 255, 0.75),   /* left highlight */
    2px 0 0 rgba(0, 0, 0, 0.10),               /* right edge */
    0 2px 0 rgba(0, 0, 0, 0.12),               /* bottom edge */
    10px 12px 24px rgba(0, 0, 0, 0.16);        /* ambient drop */
  color: #000;                         /* black text */
}
.front-page-card:hover {
  background-color: #E6F0F7;           /* soft cool hover background */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),    /* brighter top highlight */
    inset 1px 0 0 rgba(255, 255, 255, 0.8),    /* brighter left highlight */
    3px 0 0 rgba(0, 0, 0, 0.12),               /* stronger right edge */
    0 3px 0 rgba(0, 0, 0, 0.16),               /* stronger bottom edge */
    14px 16px 28px rgba(0, 0, 0, 0.20);        /* deeper ambient drop */
  color: #000;
}
.front-page-card:active {
  transform: translateY(1px);
}

.front-page-icon {
  font-size: 2.25rem; /* container size for icon */
  line-height: 1;
}
.front-page-icon .bi {
  font-size: 2.25rem; /* ensure the <i> scales to the same size */
  display: inline-block;
  vertical-align: middle;
}

.front-page-label {
  font-weight: 600;
  color: #000;
}

/* === Unified action buttons for consistent UI across pages === */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center; /* center icon+label horizontally */
  text-align: center;      /* center text on w-100 buttons */
  gap: .5rem;              /* space between icon and label */
  min-width: 140px;        /* consistent width for action lists */
  font-weight: 600;        /* slightly bolder for prominence */
  /* 3D effect: inner highlights + right/bottom edges + ambient drop */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 1px 0 0 rgba(255, 255, 255, 0.75),
    2px 0 0 rgba(0, 0, 0, 0.10),
    0 2px 0 rgba(0, 0, 0, 0.12),
    10px 12px 24px rgba(0, 0, 0, 0.16);
  transition: transform .06s ease, box-shadow .15s ease;
}
.btn-action:active { transform: translateY(1px); }

/* Sizes & shape helpers */
.btn-md   { padding: .55rem 1rem; font-size: 1rem; }
.btn-wide { min-width: 180px; }
.btn-pill { border-radius: 999px; }

/* Icon sizing baseline */
.btn-action .bi { line-height: 1; }

/* Accessible focus ring */
.btn-action:focus-visible {
  outline: 3px solid rgba(0,171,228,.45); /* bright blue #00ABE4 @45% */
  outline-offset: 2px;
}

/* Disabled state */
.btn-action:disabled,
.btn-action.disabled {
  opacity: .65;
  cursor: not-allowed;
  box-shadow: none;
}

/* Variants (inherit Bootstrap colors, unify behavior) */
.btn-back {}
.btn-edit {}
.btn-service {}
.btn-sell {}
.btn-unsell {}
.btn-transfer {}
.btn-stolen {}
.btn-unstolen {}
.btn-delete {}

/* Unified hover elevation */
.btn-action:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.90),
    inset 1px 0 0 rgba(255, 255, 255, 0.80),
    3px 0 0 rgba(0, 0, 0, 0.12),
    0 3px 0 rgba(0, 0, 0, 0.16),
    14px 16px 28px rgba(0, 0, 0, 0.20);
}

/* === Brand colors for specific action buttons === */
/* Use bright blue on edit & service buttons without affecting all .btn-info globally */
.btn-info.btn-edit,
.btn-info.btn-service {
  background-color: #517891;
  border-color: #517891;
  color: #fff;
}
.btn-info.btn-edit:hover,
.btn-info.btn-service:hover {
  background-color: #45687D; /* slightly darker on hover */
  border-color: #45687D;
}
.btn-info.btn-edit:active,
.btn-info.btn-service:active {
  background-color: #3D5E71; /* active press state */
  border-color: #3D5E71;
}
.btn-info.btn-edit:focus,
.btn-info.btn-service:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 171, 228, 0.25);
}

/* === List group section headers (bright blue) === */
.list-group-title {
  background-color: #517891;  /* bright blue */
  color: #fff;                 /* white text for contrast */
  border-color: #517891;
  font-weight: 700;
}
.list-group-title a,
.list-group-title .bi,
.list-group-title strong { color: #fff; }