@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;700&display=swap');

/* Base Reset and Global Styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}
body {
  font-family: 'Raleway', sans-serif;
  /* Lighter blue overlay on background image - am redus opacitatea pentru un look mai deschis */
  background: linear-gradient(rgba(18,42,68,0.4), rgba(18,42,68,0.4)), url('background.png'); /* MODIFICAT 0.5 -> 0.4 */
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: #333;
}

/* Linkuri generale (contrast mai bun) */
a {
  color: #4da6ff;
  text-decoration: none;
}
a:hover {
  color: #3b8ac4;
}

/* Main Wrapper */
.page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Header / Navigation */
nav {
  background: rgba(18,42,68,0.3); /* MODIFICAT 0.6 -> 0.3 pentru transparență mai mare */
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px); /* MODIFICAT 15px -> 20px pentru blur mai puternic */
  border-bottom: 1px solid rgba(77,166,255,0.2); /* MODIFICAT 0.4 -> 0.2 */
}
.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.nav-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.nav-logo {
  width: 140px;
  transition: transform 0.3s ease;
  margin-right: 20px;
}
.nav-logo:hover {
  transform: scale(1.05);
}

/* Navigation Menu & Links */
.nav-menu a {
  color: #fff; /* alb, pentru contrast mai bun pe background mai deschis */
  font-weight: 600;
  margin-right: 15px;
  padding: 8px 16px;
  transition: background-color 0.3s, color 0.3s;
}
.nav-menu a:hover {
  background-color: #4da6ff;
  color: #fff;
}

/* Right-side nav link (Logout) */
.nav-right a {
  color: #fff;
  background-color: #4da6ff;
  font-weight: 600;
  padding: 10px 20px;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
  white-space: nowrap;
}
.nav-right a:hover {
  background-color: #3b8ac4;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(61,139,190,0.4);
}

/* Main Content */
.content {
  width: 90%;
  max-width: 1600px;
  margin: 30px auto;
  background: #fff;
  padding: 30px 40px;
  border: 1px solid rgba(77,166,255,0.4);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  flex: 1;
  transition: all 0.3s ease;
}
.content:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
h1, h2, h3 {
  color: #2a4d6e;
  margin-top: 0;
}

/* Forms and Buttons */
form {
  margin-top: 15px;
  text-align: left;
}
label {
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 5px;
  color: #333;
  display: block;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  margin-bottom: 15px;
  border: 2px solid rgba(77,166,255,0.8);
  border-radius: 0; /* square corners */
  transition: border-color 0.3s, box-shadow 0.3s;
  background: #fff;
  color: #333;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
  border-color: #ff704d;
  box-shadow: 0 0 12px rgba(255,112,77,0.5);
  outline: none;
}
select {
  border: 2px solid rgba(77,166,255,0.8);
  background: #fff;
  border-radius: 0;
  padding: 8px 16px;
  font-weight: 600;
  color: #2a4d6e;
  margin-right: 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}
select:hover {
  box-shadow: 0 4px 8px rgba(77,166,255,0.3);
}

/* Primary Buttons */
.button-primary, button, a.button-primary {
  background: #4da6ff;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 0; /* square corners */
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}
.button-primary:hover, button:hover, a.button-primary:hover {
  background-color: #3b8ac4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(61,139,190,0.4);
}

/* Unique Button (Green) */
.button-unique {
  background-color: #2ecc71;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
  margin-left: 0 !important;
}
.button-unique:hover {
  background-color: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39,174,96,0.4);
}

/* Tables */
.table-responsive {
  width: 100%;
  margin-top: 20px;
  overflow-x: auto; /* scrollbar orizontal dacă e necesar */
  -webkit-overflow-scrolling: touch;
}

.compact-table {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  border-collapse: collapse;
  border: 1px solid rgba(77,166,255,0.5);
  border-radius: 0;
  overflow: hidden;
  table-layout: auto;
  word-wrap: break-word;
}
.compact-table th,
.compact-table td {
  border: none;
  padding: 6px 8px;
  text-align: left;
  font-size: 13px;
  white-space: normal;
}
.compact-table th {
  background-color: rgba(77,166,255,0.1);
  color: #4da6ff;
  font-weight: 600;
}
.compact-table tr:nth-child(even) {
  background-color: rgba(77,166,255,0.03);
}
.compact-table tr:hover {
  background-color: rgba(77,166,255,0.08);
}

/* Filters */
.filter-container {
  margin-bottom: 15px;
}
.filter-container input[type="text"] {
  width: 200px;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border: 2px solid rgba(77,166,255,0.8);
  border-radius: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: #fff;
  color: #333;
}
.filter-container input[type="text"]:focus {
  border-color: #ff704d;
  box-shadow: 0 0 8px rgba(255,112,77,0.5);
  outline: none;
}

/* Pagination */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
  gap: 5px;
}
.pagination .page-buttons {
  display: flex;
  gap: 5px;
}
.pagination .page-buttons button,
.pagination .page-buttons a {
  padding: 8px 14px;
  border: 1px solid #ddd;
  background: #fff;
  color: #4da6ff;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  border-radius: 0;
  text-decoration: none;
  font-size: 13px;
}
.pagination .page-buttons button:hover,
.pagination .page-buttons a:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}
.pagination .page-buttons .current-page {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 2px;
  background-color: #4da6ff;
  color: #fff;
  border-radius: 0;
  font-size: 13px;
  cursor: default;
}
.total-pages {
  margin-top: 5px;
  text-align: center;
  font-size: 14px;
  color: #4da6ff;
}

/* Footer */
footer {
  background: rgba(18,42,68,0.3); /* MODIFICAT 0.6 -> 0.3 pentru transparență mai mare */
  color: #fff;
  text-align: center;
  padding: 20px 10px;
  backdrop-filter: blur(20px); /* MODIFICAT 25px -> 20px */
  border-top: 1px solid rgba(77,166,255,0.2); /* MODIFICAT 0.3 -> 0.2 */
  margin-top: 30px;
  position: relative;
}
footer .footer-content {
  margin-bottom: 40px;
  font-size: 14px;
}
.footer-nav a {
  margin: 0 10px;
  font-weight: 600;
  color: #fff; /* alb, pentru contrast mai bun */
}
.footer-nav a:hover {
  color: #4da6ff;
  text-decoration: underline;
}
.footer-logo {
  margin-top: 20px;
  text-align: center;
}
.footer-logo img {
  width: 120px;
}

/* Login Container */
.login-container {
  background: rgba(18,42,68,0.6); /* MODIFICAT 0.8 -> 0.6 */
  padding: 30px;
  max-width: 400px;
  margin: 80px auto;
  border-radius: 0;
  box-shadow: 0 6px 15px rgba(0,0,0,0.7);
  border: 1px solid rgba(77,166,255,0.6);
  animation: fadeIn 1s ease-in-out;
  color: #fff; /* MODIFICAT - text alb pentru contrast */
}
.login-container h2 {
  text-align: center;
  color: #4da6ff;
  margin-bottom: 20px;
}
.login-container form {
  display: flex;
  flex-direction: column;
}
.login-container input[type="text"],
.login-container input[type="password"],
.login-container input[type="email"],
.login-container input[type="number"] {
  padding: 12px;
  margin-bottom: 15px;
  border: 2px solid rgba(77,166,255,0.8);
  border-radius: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: #fff; 
  color: #333;
}
.login-container input:focus {
  border-color: #ff704d;
  box-shadow: 0 0 12px rgba(255,112,77,0.5);
  outline: none;
}
.login-container button {
  padding: 12px;
  border: none;
  background-color: #4da6ff;
  color: #fff;
  border-radius: 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.login-container button:hover {
  background-color: #3b8ac4;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(61,139,190,0.4);
}

/* Install Container (for install.php) */
.install-container {
  background: rgba(18,42,68,0.6); /* mai deschis pentru consistență cu login-container */
  padding: 30px;
  max-width: 600px;
  margin: 80px auto;
  text-align: center;
  border-radius: 0;
  box-shadow: 0 6px 15px rgba(0,0,0,0.7);
  border: 1px solid rgba(77,166,255,0.6);
  animation: fadeIn 1s ease-in-out;
  color: #fff;
}
.install-container h2 {
  text-align: center;
  color: #4da6ff;
  margin-bottom: 20px;
}
.install-container form {
  display: flex;
  flex-direction: column;
}
.install-container fieldset {
  border: 1px solid rgba(77,166,255,0.6);
  padding: 15px;
  margin-bottom: 20px;
}
.install-container legend {
  padding: 0 10px;
  font-weight: 600;
  color: #4da6ff;
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .table-responsive {
    overflow-x: auto;
  }
}
@media (max-width: 576px) {
  .compact-table thead {
    display: none;
  }
  .compact-table,
  .compact-table tbody,
  .compact-table tr,
  .compact-table td {
    display: block;
    width: 100%;
  }
  .compact-table tr {
    margin-bottom: 10px;
    border: 1px solid rgba(77,166,255,0.5);
    border-radius: 0;
    padding: 10px;
    background-color: rgba(77,166,255,0.03);
  }
  .compact-table td {
    border: none;
    border-bottom: 1px dotted #ccc;
    padding: 8px;
    margin-bottom: 8px;
    position: relative;
  }
  .compact-table td:before {
    content: attr(data-label);
    display: block;
    font-weight: bold;
    color: #d0d0d0;
    margin-bottom: 3px;
  }
  .compact-table td:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }
  
  .content {
    margin: 15px auto;
    padding: 20px;
  }
  .nav-left, .nav-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .nav-menu a {
    margin-right: 8px;
    margin-top: 5px;
    font-size: 13px;
  }
  .nav-logo {
    width: 120px;
    margin-right: 10px;
  }
  button, .button-primary, a.button-primary {
    font-size: 12px;
    padding: 10px 16px;
    margin-top: 5px;
  }
  select {
    font-size: 12px;
    padding: 6px 10px;
    margin-top: 5px;
  }
  .filter-container input[type="text"] {
    width: 100%;
    margin-bottom: 8px;
  }
  footer {
    padding: 15px 5px;
  }
}
