@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #ffffff;
  color: #111111;
  width: 450px !important;
  height: 600px !important;
  overflow: hidden;
  transition: none !important;
}

.container {
  width: 450px !important;
  height: 600px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #f8f9fa;
  background-image: 
    linear-gradient(45deg, #f1f3f5 25%, transparent 25%), 
    linear-gradient(-45deg, #f1f3f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f3f5 75%),
    linear-gradient(-45deg, transparent 75%, #f1f3f5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  position: relative;
  transition: none !important;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255,255,255,0.95) 0%, 
    rgba(255,255,255,0.85) 100%
  );
  backdrop-filter: blur(1px);
  pointer-events: none;
}

.view {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  padding: 16px;
  opacity: 0;
}

.view.active {
  display: flex;
  opacity: 1;
}

.header {
  text-align: center;
  margin-bottom: 12px;
  position: relative;
  padding: 4px 0;
}

.header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #111111;
  letter-spacing: -0.3px;
  margin: 0;
  background: linear-gradient(135deg, #000000 0%, #333333 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.version-badge {
  font-size: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  padding: 4px 8px;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  -webkit-text-fill-color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

#subapp-title {
  font-size: 20px;
  font-weight: 600;
  color: #111111;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 15px;
  color: #111111;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.back-btn:hover {
  background-color: rgba(0,0,0,0.05);
}

.core-buttons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.core-btn {
  position: relative;
  background: linear-gradient(135deg, #111111 0%, #2c2c2c 100%);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 48%;
  overflow: hidden;
}

.core-btn:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-container {
  margin-bottom: 12px;
  position: relative;
}

#search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  background-color: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
}

#search-input:focus {
  border-color: #111111;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  background-color: #ffffff;
}

.button-container,
.subapp-button-container {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 4px;
  overflow-y: auto;
  max-height: calc(100vh - 150px);
  scrollbar-width: thin;
  scrollbar-color: #d1d1d1 transparent;
  scroll-behavior: smooth;
}

.button-container::-webkit-scrollbar,
.subapp-button-container::-webkit-scrollbar {
  width: 4px;
}

.button-container::-webkit-scrollbar-track,
.subapp-button-container::-webkit-scrollbar-track {
  background: transparent;
}

.button-container::-webkit-scrollbar-thumb,
.subapp-button-container::-webkit-scrollbar-thumb {
  background-color: #d1d1d1;
  border-radius: 2px;
}

.button-container::-webkit-scrollbar-thumb:hover,
.subapp-button-container::-webkit-scrollbar-thumb:hover {
  background-color: #999999;
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255,255,255,0.9);
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 8px 6px;
  width: 100%;
  height: 84px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.btn:hover {
  border-color: #111111;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  background-color: #ffffff;
}

.btn img {
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  object-fit: contain;
}

.btn span {
  font-size: 11px;
  color: #111111;
  font-weight: 500;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  padding: 0 2px;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled:hover {
  border-color: #e5e5e5;
  box-shadow: none;
}

.footer {
  margin-top: 10px;
  text-align: center;
}

#message,
#subapp-message {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  display: none;
  color: #666666;
}

#message.info,
#subapp-message.info {
  color: #111111;
  display: block;
}

#message.error,
#subapp-message.error {
  color: #dc2626;
  display: block;
}

@media (max-width: 400px) {
  .button-container,
  .subapp-button-container {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .btn {
    height: 80px;
  }
  
  .btn img {
    width: 30px;
    height: 30px;
  }
  
  .btn span {
    font-size: 10px;
  }
}

#unusual-activity-message {
  background-color: #f8d7da;
  color: #721c24;
  text-align: center;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}