:root {
  --primary: #0b4fb6;
  --secondary: #63d6d7;
  --white: #ffffff;
  --card: #f2f2f2;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Be Vietnam Pro", sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  overflow-x: hidden;
  position: relative;
}

.watermark {
  position: fixed;
  inset: 0;
  background-image: url("logo-center.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(45vw, 500px);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.header {
  position: relative;
  z-index: 2;
  padding: 35px 20px;
  text-align: center;
}

.header h1 {
  color: white;
  font-size: clamp(26px, 3vw, 58px);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.btn-setting {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 28px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.btn-setting:hover {
  background: rgba(255, 255, 255, 0.25);
}

.apps-container {
  position: relative;
  z-index: 2;

  width: min(1400px, 95%);
  margin: auto;

  display: grid;
  grid-template-columns: repeat(4, 1fr);

  gap: 60px;
  padding: 40px 20px 80px;
}

.app-card {
  width: 180px;
  height: 180px;

  background: var(--card);

  border-radius: 18px;

  margin: auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  transition: 0.25s ease;

  box-shadow: var(--shadow);
}

.app-card:hover {
  transform: translateY(-5px);
}

.app-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.app-name {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #000;
  padding: 0 10px;
}

.empty {
  opacity: 0.5;
}

.modal {
  position: fixed;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.5);

  z-index: 999;
}

.modal-content {
  width: min(720px, 95%);
  max-height: 90vh;
  overflow: auto;

  background: white;
  border-radius: 18px;

  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 20px;

  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  font-size: 28px;
}

.modal-header button {
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

label {
  display: block;
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 700;
}

input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 10px 14px;

  border: 1px solid #ddd;
  border-radius: 10px;

  font-size: 16px;
}

input[type="file"] {
  width: 100%;
}

.preview-image {
  width: 140px;
  height: 140px;
  object-fit: contain;

  display: none;

  margin-top: 10px;

  border: 1px solid #ddd;
  border-radius: 10px;
}

.toolbar {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary {
  background: #0b73ff;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-danger {
  background: #dc3545;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}

#appList {
  margin-top: 20px;
}

.manage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px;

  border-bottom: 1px solid #eee;
}

.manage-actions button {
  margin-left: 5px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.edit-btn {
  background: #ffc107;
}

.delete-btn {
  background: #dc3545;
  color: white;
}

@media (max-width: 1024px) {
  .apps-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .apps-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .app-card {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 24px;
  }

  .app-card {
    width: 130px;
    height: 130px;
  }
}
