@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap");

:root {
  --primary-color: #3a86ff;
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #e9ecef;
  --hover-color: #0056b3;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--light-color);
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  width: 60px;
  height: 60px;
  margin-right: 15px;
  border-radius: 50%;
  object-fit: cover;
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.logo-text p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.tema-info {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 20px;
}

.tema-info h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.tema-info p {
  font-size: 1rem;
  opacity: 0.9;
}


main {
  flex: 1;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.tests-container {
  padding: 0 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-color);
}

.section-header h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.progress-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.progress-bar {
  width: 150px;
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
}

.progress-indicator span {
  font-size: 0.8rem;
  color: #6c757d;
}


.tests-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.test-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.test-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.test-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 15px;
}

.test-header i {
  font-size: 1.5rem;
}

.test-header h4 {
  font-size: 1.2rem;
  font-weight: 500;
}

.test-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.test-content p {
  margin-bottom: 1.5rem;
  color: #495057;
  flex: 1;
}

.test-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.test-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #6c757d;
}

.test-meta i {
  color: var(--primary-color);
}

.test-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}


.applications-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  align-items: stretch;
}

.application-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.application-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.application-header {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 15px;
}

.application-header i {
  font-size: 1.5rem;
}

.application-header h4 {
  font-size: 1.2rem;
  font-weight: 500;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
}

.application-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.application-content p {
  margin-bottom: 1.5rem;
  color: #495057;
  flex: 1;
}

.application-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.application-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #6c757d;
}

.application-meta i {
  color: var(--secondary-color);
}

.application-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}


.materials-filters {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.search-group {
  flex: 1;
  min-width: 250px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  left: 12px;
  color: #6c757d;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.search-input:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(58, 134, 255, 0.25);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: background-color 0.2s;
}

.clear-search-btn:hover {
  background-color: #f8f9fa;
  color: var(--danger-color);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
}

.filter-select {
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out;
}

.filter-select:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(58, 134, 255, 0.25);
}

.filter-actions {
  display: flex;
  align-items: flex-end;
}

.filters-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-color);
  font-size: 0.9rem;
  color: #6c757d;
}

#materials-count {
  font-weight: 500;
}

#count-value {
  color: var(--primary-color);
  font-weight: 600;
}


.materials-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.material-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.material-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.material-header {
  background-color: var(--info-color);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 15px;
}

.material-header i {
  font-size: 1.5rem;
}

.material-header h4 {
  font-size: 1.2rem;
  font-weight: 500;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
}

.material-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.material-content p {
  margin-bottom: 1.5rem;
  color: #495057;
  flex: 1;
}

.material-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #6c757d;
}

.material-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: auto;
}

.material-actions .btn {
  flex-shrink: 0;
}


mark {
  background-color: #fff3cd;
  color: #856404;
  padding: 0.1em 0.2em;
  border-radius: 2px;
}


.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 4px;
  transition: all 0.3s;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  color: white;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--hover-color);
  border-color: var(--hover-color);
  transform: translateY(-2px);
}

.btn-outline {
  color: var(--primary-color);
  background-color: transparent;
  border-color: var(--primary-color);
}

.btn-outline:hover {
  color: white;
  background-color: var(--primary-color);
  transform: translateY(-2px);
}

.btn-danger {
  color: white;
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn i {
  margin-right: 8px;
}


.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 500px;
  animation: modalFadeIn 0.3s ease-out forwards;
}

.emulator-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  width: 1200px;
  height: 800px;
}

.emulator-body {
  padding: 0;
  height: 700px;
}

.emulator-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.modal-header h4 {
  font-size: 1.2rem;
  font-weight: 500;
}

.close-modal {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.close-modal:hover {
  transform: scale(1.1);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin-bottom: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid var(--gray-color);
}


.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  grid-column: 1 / -1;
}

.loading-spinner i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}


footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright p {
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 1;
}


.user-dropdown {
  position: absolute;
  top: 1rem;
  right: 2rem;
  z-index: 1000;
  min-width: 200px;
}

.user-dropdown-toggle {
  background-color: rgba(255, 255, 255, 0.15);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  transition: background-color 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.user-dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--primary-color);
  color: white;
  border-radius: 8px;
  width: 220px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  padding: 10px 0;
  display: none;
  animation: dropdownFade 0.3s ease-out;
}

.user-dropdown.active .user-dropdown-menu {
  display: block;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-info {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.2s;
}

.dropdown-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-link i {
  width: 20px;
  text-align: center;
}


.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(58, 134, 255, 0.25);
}

.form-control-file {
  display: block;
  width: 100%;
  padding: 0.5rem 0;
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.progress {
  height: 8px;
  margin: 1rem 0;
  overflow: hidden;
  background-color: #e9ecef;
  border-radius: 4px;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}


.delete-warning {
  text-align: center;
  padding: 1rem 0;
}

.delete-warning i {
  font-size: 3rem;
  color: var(--danger-color);
  margin-bottom: 1rem;
}

.delete-warning p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.warning-text {
  color: var(--danger-color);
  font-weight: 500;
  font-size: 0.9rem !important;
}


.no-materials {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.error-message {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--danger-color);
  font-size: 1rem;
  grid-column: 1 / -1;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
}


body.dark-theme {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-theme .test-card,
body.dark-theme .material-card,
body.dark-theme .application-card,
body.dark-theme .modal-content,
body.dark-theme .materials-filters {
  background-color: #1e1e1e;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-theme .test-content p,
body.dark-theme .material-content p,
body.dark-theme .application-content p {
  color: #c0c0c0;
}

body.dark-theme .test-meta span,
body.dark-theme .material-meta,
body.dark-theme .application-meta span {
  color: #a0a0a0;
}

body.dark-theme .modal-footer,
body.dark-theme .filters-info {
  border-top-color: #333;
}

body.dark-theme .form-control,
body.dark-theme .filter-select,
body.dark-theme .search-input {
  background-color: #333;
  border-color: #555;
  color: #e0e0e0;
}

body.dark-theme .alert-success {
  background-color: #1e4a30;
  border-color: #2a6844;
  color: #d4edda;
}

body.dark-theme .alert-danger {
  background-color: #4a1e1e;
  border-color: #682a2a;
  color: #f8d7da;
}

body.dark-theme .error-message {
  background-color: #4a1e1e;
  border-color: #682a2a;
  color: #f8d7da;
}

body.dark-theme .no-materials {
  color: #a0a0a0;
}

body.dark-theme .user-dropdown-menu {
  background-color: #333;
}

body.dark-theme .delete-warning i {
  color: #ff6b6b;
}

body.dark-theme .warning-text {
  color: #ff6b6b;
}

body.dark-theme mark {
  background-color: #4a4a00;
  color: #ffff99;
}


@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .progress-indicator {
    align-items: flex-start;
    width: 100%;
  }

  .progress-bar {
    width: 100%;
  }

  .test-meta,
  .application-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .materials-list,
  .applications-list {
    grid-template-columns: 1fr;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-group {
    min-width: auto;
  }

  .filter-group {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .filter-group label {
    white-space: nowrap;
    margin-bottom: 0;
  }

  .emulator-modal-content {
    width: 95vw;
    height: 95vh;
  }

  .emulator-body {
    height: calc(95vh - 80px);
  }
}

@media (max-width: 576px) {
  .test-actions,
  .material-actions,
  .application-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    gap: 1rem;
  }

  .material-actions .btn,
  .application-actions .btn {
    width: 100%;
  }

  .filters-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
