@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background-color: #121212;
  color: #ffffff;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease, opacity 0.2s ease;
}

input, select,
.tab,
.entry,
.card,
.popup-box,
.month-history,
.year-btn,
.filter,
.total-row {
  transition: background-color 0.3s ease, color 0.3s ease, border 0.3s ease;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

input[type="date"]::-webkit-calendar-picker-indicator{
filter:
invert(77%)
sepia(84%)
saturate(749%)
hue-rotate(115deg)
brightness(103%)
contrast(103%);

cursor:pointer;
opacity:1;
transform:scale(1);
}

body.light input[type="date"]::-webkit-calendar-picker-indicator{
filter:
invert(15%)
sepia(92%)
saturate(7000%)
hue-rotate(355deg)
brightness(95%)
contrast(110%);
}

.container {
  max-width: 500px;
  margin: auto;
  padding: 20px;
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

h1 {
  text-align: center;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
}

.tab {
  padding: 10px;
  text-align: center;
  background-color: #1e1e1e;
  cursor: pointer;
  border-bottom: 2px solid transparent;

  flex-grow: 1;
}

.settings-tab {
  flex-grow: 0.5;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab.active {
  border-bottom: 2px solid #629665;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

label {
  font-size: 13px;
  opacity: 0.7;
}

.row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.row input,
.row select {
  flex: 1;
  min-width: 0;
}

input, select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin: 5px 0 10px 0;
  background-color: #1e1e1e;
  color: white;
  border: 1px solid #333;
  border-radius: 8px;
  
  font-size: 16px;
  
  min-width: 0;
  min-height:42px;
  appearance: none;
}

.small {
  width: 80px;
  flex: 0 0 80px;
}

button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background-color: #629665;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 8px;
  
  touch-action: manipulation;
}

/* BUTTON PRESS */
button:active {
  transform: scale(0.97);
}

/* NEW ENTRY */
.entry-new {
  animation: entryAppear 1.6s ease forwards;
}

@keyframes entryAppear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* NEW ENTRY HIGHLIGHT */
.entry-highlight {
  box-shadow: 0 0 12px rgba(0,255,204,0.5);
  border-left-color: #00ff88;
}

#addBtn, #cancelEditBtn {
color: black;
font-size: 14px;
}

/* DELETE ENTRY */
.entry-removing {
  opacity: 0;
  transform: translateX(-30px) scale(0.95);

  max-height: 100px;

  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;

  overflow: hidden;

  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    max-height 0.35s ease,
    padding 0.35s ease,
    margin 0.35s ease;
}

.history {
  margin-top: 20px;
}

.entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e1e1e;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 4px solid #629665;
}

.entry-content {
  font-size: 13px;
}

.delete {
  color: red;
  cursor: pointer;
  font-weight: bold;
}

.stats {
  text-align: center;
}

.labels-row label {
  flex: 1;
}

/* POPUP OVERLAY */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* ascuns */
.hidden {
  display: none;
}

/* box */
.popup-box {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 12px;
  width: 280px;
  text-align: center;

  transform: scale(0.8);
  opacity: 0;
  transition: all 0.25s ease;
}

.popup.show {
  opacity: 1;
  pointer-events: all;
}

.popup.show .popup-box {
  transform: scale(1);
  opacity: 1;
}

/* text */
.popup-box p {
  margin-bottom: 20px;
}

/* butoane */
.popup-actions {
  display: flex;
  gap: 10px;
}

.popup-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* cancel */
.cancel {
  background: #333;
  color: white;
}

/* delete */
.confirm {
  background: #ff4d4d;
  color: white;
}

.type.AC {
  color: #4da6ff;
}

.type.DC {
  color: #ff4d4d;
}

.entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.entry-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.total {
  color: #6ca86f;
  font-weight: 600;
}

/* HISTORY HEADER */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* FILTER BUTTONS */
.filters {
  display: flex;
  gap: 5px;
}

.filter {
  background: #1e1e1e;
  border: 1px solid #333;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.filter.active {
  background: #629665;
  color: black;
}

/* STATS FILTER */
.stats-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.stats-filter > div:not(.refresh-box) {
  flex: 1;
}

/* GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* CARD */
.card {
  background: #1e1e1e;
  padding: 8px;
  border-radius: 10px;
  text-align: center;
}

.card h3 {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 5px;
}

.card p {
  font-size: 20px;
  font-weight: 600;
}

.card small {
  font-size: 12px;
  opacity: 0.6;
}

/* TITLE WITH LOGO */
.login-title {
color: #f2f5f2;
text-shadow:
0 0 6px black,
0 0 8px lightgrey;

display: flex;
align-items: center;
justify-content: left;
gap: 1px;
text-align: left;
}

#loginBtn {
color: #f2f5f2;
background: #629665;

font-size: 15px;
}

/* TITLE WITH LOGO */
.app-title {
color: #629665;

display: flex;
align-items: center;
justify-content: center;
gap: 1px;
text-align: center;
}

.logo {
  width: 90px;
  height: 90px;
  border-radius: 6px;
}

.demo-subtitle {
  text-align: center;
  color: #888888;
  font-size: 0.85rem;
  margin-top: -15px;
  margin-bottom: 20px;
  font-weight: 300;
  display: block;
}

.app-subtitle {
color: #629665;
margin-left: 5px;
margin-top: -10px;
margin-bottom: 20px;
}
	
/* REFRESH BUTTON */
.refresh-box {
  display: flex;
  align-items: flex-end;
}

#refreshStats {
all: unset; /* 👈 asta anuleaza complet stilul global */

cursor: pointer;
color: white;
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
margin-top: 0;
margin-bottom: 10px;
}

/* YEAR BUTTONS */
.year-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.year-btn {
  padding: 6px 12px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
}

.year-btn.active {
  background: #629665;
  color: black;
}

/* TABLE */
.overview-table {
  width: 100%;
  border-collapse: collapse;
}

.overview-table th,
.overview-table td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #333;
}

.overview-table tr.current-month {
  background: rgba(0, 255, 204, 0.1);
}

.ac {
  color: #4da6ff;
}

.dc {
  color: #ff4d4d;
}

.total-row {
  font-weight: bold;
  background: #1e1e1e;
}

/* STATS HEADER */
.stats-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

/* FADE MONTHS */
.overview-table tr.empty {
  opacity: 0.4;
}

/* MONTH HISTORY */
.month-history {
  margin-top: 15px;
  background: #1e1e1e;
  padding: 10px;
  border-radius: 10px;

  overflow: hidden;
  max-height: 0;
  opacity: 0;

  -webkit-overflow-scrolling: touch;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.month-history.active {
  max-height: 70dvh;
  opacity: 1;
  overflow-y: auto;
}

.month-history h3 {
  margin-bottom: 10px;
}

.month-entry {
  font-size: 13px;
  margin-bottom: 5px;
}

.edit {
  background: #ffaa00;
  color: black;
}

.auth-divider {
  text-align: center;
  margin: 12px 0;
  opacity: 0.6;
  font-size: 14px;
}

.auth-link {
  text-align: center;
  color: #629665;
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
}

.auth-link:hover {
  opacity: 0.7;
}

/* Ascunde buton Register */
.hidden-auth {
  display: none;
}

.settings-link {
display: flex;
align-items: center;
gap: 8px;
margin-top: 35px;

cursor: pointer;
color: #ff4d4d;

font-size: 15px;
}

.settings-link svg {
stroke: #ff4d4d;
}

.settings-link:hover {
  opacity: 0.7;
}

.sync-status {
  font-size: 12px;
  opacity: 0.7;
  margin-left: auto;
  text-shadow: none;
  margin-top: 15px;
}

.sync-status.saving {
  color: orange;
}

.sync-status.offline {
  color: #ff4d4d;
}

.sync-status.saved {
  color: #4caf50;
}

/* LIGHT MODE */
body.light {
  background-color: #ffffff;
  color: #111;
}

body.light input,
body.light select {
  background-color: #f5f5f5;
  color: #111;
  border: 1px solid #ccc;
}

body.light .tab,
body.light .entry,
body.light .card,
body.light .popup-box,
body.light .month-history,
body.light .year-btn {
  background-color: #f5f5f5;
  color: #111;
}

body.light .filter {
  background: #eee;
  color: #111;
  border: 1px solid #ccc;
}

body.light .filter.active,
body.light .year-btn.active {
  background: #629665;
  color: black;
}

body.light .total-row {
  background: #eee;
}

body.light .cancel {
  background: #ddd;
  color: #111;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: 15px;
  margin-bottom: 20px;

  cursor: pointer;
  color: white;
  font-size: 16px;
}

.settings-item svg {
  stroke: white;
}

.settings-item:hover {
  opacity: 0.7;
}

.version {
  color: grey;
  font-size: 14px;

  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;

  text-align: center;
}

body.light .settings-item {
  color: #111;
}

body.light .settings-item svg {
  stroke: #111;
}

.month-title {
  color: #ff4d4d;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.entry-date {
  color: #ff4d4d;
  font-weight: 500;
  margin-right: 1px;
}

.odometer{
color:#777;
}

.language-grid {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  margin-top: -10px;
}

.language-option {
  flex: 1;
  text-align: center;
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.language-option:hover {
  background: rgba(255,255,255,0.08);
}

.flag {
  font-size: 30px;
  margin-bottom: 6px;
}
