:root {
  --accent: #7c5cff;
  --accent2: #441af0;
  --accent3: #2fdcff;
  --text: #cfd6ff;
  --text-muted: #5d6793;
  --bg-dark: #05060d;
  --glow-purple: 0 0 15px rgba(124, 92, 255, 0.5);
  --glow-cyan: 0 0 15px rgba(0, 102, 255, 0.5);
  --text-glow-cyan: 0 0 10px rgba(47, 220, 255, 0.6);
  --text-glow-purple: 0 0 10px rgba(124, 92, 255, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at top, #0b0f2a, var(--bg-dark));
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  overflow: hidden;
  line-height: 1.5;
}

svg {
  fill: #ffffff !important;
  transition: filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

svg[stroke] {
  stroke: #ffffff !important;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(5, 6, 13, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 255, 0.2);
  border-radius: 3px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  box-shadow: var(--glow-purple);
}

#loader {
  position: fixed;
  inset: 0;
  background: #060713; 
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-content img {
  width: 180px;
  height: 180px;
  max-width: 180px;
  max-height: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0; 
  filter: drop-shadow(0 0 25px rgba(0, 102, 255, 0.45)); 
  animation: pulseLogo 2s ease-in-out infinite;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 102, 255, 0.1);
  border-radius: 50%;
  border-top-color: #0066ff; 
  box-shadow: 0 0 15px rgba(0, 102, 255, 0.4); 
  animation: spin 0.8s linear infinite;
  margin: 20px auto 15px;
}

#hint {
  font-size: 15px; 
  opacity: 0.9;
  max-width: 320px;
  margin: 0 auto;
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: 0.05em;
}

@keyframes spin {
  to { 
    transform: rotate(360deg); 
  }
}

@keyframes pulseLogo {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 20px rgba(0, 102, 255, 0.4));
  }
  50% {
    transform: scale(1.03);
    filter: drop-shadow(0 0 30px rgba(0, 102, 255, 0.7));
  }
}

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 9, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: linear-gradient(150deg, rgba(13, 16, 37, 0.95) 0%, rgba(5, 6, 13, 0.98) 100%);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-top: 3px solid var(--accent2);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(124, 92, 255, 0.15);
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#welcome-icon-container, #announcement-icon-container {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(47, 220, 255, 0.05);
  border: 1px solid rgba(47, 220, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 15px rgba(47, 220, 255, 0.1);
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.modal-text {
  font-size: 13.5px;
  color: #a4b3e6;
  line-height: 1.6;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.pagination .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.pagination .dot.active {
  width: 14px;
  border-radius: 4px;
  background: var(--accent2);
  box-shadow: var(--glow-cyan);
}

.modal-footer {
  display: flex;
  width: 100%;
  gap: 12px;
  margin-top: 8px;
}

.modal-footer button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.app {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.sidebar {
  width: 56px;
  background: rgba(4, 5, 11, 0.98);
  border-right: 1px solid rgba(124, 92, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 0;
  z-index: 100;
  flex-shrink: 0;
}

.nav-group, .extra-nav-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}

.nav-btn:hover, .nav-btn.active {
  transform: translateY(-2px);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn:hover svg, .nav-btn.active svg {
  opacity: 1;
  filter: drop-shadow(0 0 4px #fff);
}

.main {
  flex: 1;
  height: 100%;
  position: relative;
  background: transparent;
  overflow: hidden;
}

.home {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 60px 40px;
  text-align: center;
  gap: 14px;
}

#contentFrame, #htmlContainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: none;
}

#htmlContainer {
  overflow: auto;
}

.logo img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(124, 92, 255, 0.4));
  margin-bottom: 6px;
  transition: filter 0.3s ease;
}

.logo img:hover {
  filter: drop-shadow(0 0 25px rgba(124, 92, 255, 0.7));
}

.title {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  text-shadow: var(--text-glow-purple);
  letter-spacing: 1px;
}

.subtitle {
  font-size: 14px;
  color: var(--text);
  max-width: 650px;
  opacity: 0.85;
  line-height: 1.6;
}

#checkversion {
  color: var(--accent2);
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124, 92, 255, 0.2);
}

.btn-primary:hover {
  background: #8b6eff;
  box-shadow: var(--glow-purple);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.stats {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.stats h1 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats img {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats img:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

.stats h2 {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
  letter-spacing: 0.5px;
}

.stats h2 a {
  color: var(--accent2);
  text-decoration: none;
  transition: color 0.2s ease;
}

.stats h2 a:hover {
  text-decoration: underline;
  color: #fff;
  text-shadow: var(--text-glow-cyan);
}

    #widget-container {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: rgba(10, 12, 30, 0.85);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(124, 92, 255, 0.2);
      padding: 14px 20px;
      border-radius: 16px;
      display: flex;
      flex-direction: column;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(124, 92, 255, 0.05);
      z-index: 50;
      width: auto;
      min-width: 180px;
      user-select: none;
      transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease, width 0.3s ease;
    }

    #widget-container:hover {
      border-color: rgba(124, 92, 255, 0.4);
      box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8), inset 0 0 25px rgba(124, 92, 255, 0.1);
    }


    .widget-summary {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      cursor: pointer;
      width: 100%;
    }

    .clock-side {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
    }

    .time-wrapper {
      display: flex;
      align-items: baseline;
      color: #fff;
    }

    #time-display {
      font-size: 24px;
      font-weight: 800;
      letter-spacing: 0.5px;
      text-shadow: 0 0 12px rgba(0, 242, 254, 0.6);
    }

    #seconds-display {
      font-size: 13px;
      color: #7c5cff;
      margin-left: 4px;
      font-weight: 700;
    }

    .details-wrapper {
      display: flex;
      gap: 12px;
      font-size: 9px;
      color: #8a8f98;
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-top: 2px;
    }

    .status-dot {
      display: inline-block;
      width: 6px;
      height: 6px;
      background: #10b981;
      border-radius: 50%;
      margin-right: 5px;
      box-shadow: 0 0 8px #10b981;
      animation: pulseDot 2s infinite;
    }

    @keyframes pulseDot {
      0% { transform: scale(0.9); opacity: 0.6; }
      50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px #10b981; }
      100% { transform: scale(0.9); opacity: 0.6; }
    }


    .battery-wrapper {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      opacity: 0;
      max-width: 0;
      transform: translateX(-15px);
      transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.3s ease;
      margin-right: 0;
      pointer-events: none;
    }

    #widget-container:hover .battery-wrapper {
      opacity: 1;
      max-width: 100px;
      transform: translateX(0);
      margin-right: 24px;
    }

    .battery-status {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #fff;
    }

    #battery-percentage {
      font-size: 16px;
      font-weight: 700;
    }

    .battery-icon-container {
      position: relative;
      width: 18px;
      height: 10px;
      border: 1px solid rgba(255, 255, 255, 0.4);
      border-radius: 2px;
      padding: 1px;
    }

    .battery-icon-container::after {
      content: '';
      position: absolute;
      right: -3px;
      top: 2.5px;
      width: 1.5px;
      height: 3px;
      background: rgba(255, 255, 255, 0.4);
      border-radius: 0 1px 1px 0;
    }

    #battery-level-bar {
      display: block;
      height: 100%;
      width: 0%;
      background: #10b981;
      border-radius: 0.5px;
      transition: width 0.3s ease, background-color 0.3s ease;
    }

    #battery-status-text {
      font-size: 8px;
      color: #8a8f98;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-top: 3px;
    }


    #calendar-section {
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      width: 100%;
      transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-top 0.4s ease;
    }

    #widget-container.expanded {
      width: 300px;
    }

    #widget-container.expanded #calendar-section {
      max-height: 280px;
      opacity: 1;
      margin-top: 16px;
    }


    #widget-container.expanded .battery-wrapper {
      opacity: 1;
      max-width: 100px;
      transform: translateX(0);
      margin-right: auto; 
    }

    .divider {
      border: none;
      height: 1px;
      background: rgba(124, 92, 255, 0.15);
      margin-bottom: 14px;
    }

    .calendar-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
      color: #fff;
    }

    #calendar-month-year {
      font-weight: 700;
      font-size: 13px;
      letter-spacing: 0.5px;
    }

    .calendar-nav-btn {
      background: transparent;
      border: none;
      color: #8a8f98;
      cursor: pointer;
      font-size: 11px;
      padding: 4px 8px;
      border-radius: 6px;
      transition: color 0.2s, background 0.2s;
    }

    .calendar-nav-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.08);
    }

    .calendar-weekdays {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      text-align: center;
      font-size: 10px;
      color: #8a8f98;
      font-weight: 700;
      margin-bottom: 6px;
    }

    .calendar-days {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      text-align: center;
      row-gap: 4px;
      color: #fff;
    }

    .day {
      font-size: 11px;
      aspect-ratio: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      border-radius: 50%;
      transition: background 0.2s, color 0.2s;
    }

    .day:hover:not(.today) {
      background: rgba(255, 255, 255, 0.08);
    }

    .day.prev-date, .day.next-date {
      color: rgba(255, 255, 255, 0.2);
    }

    .day.today {
      background: #7c5cff;
      color: #fff;
      font-weight: 700;
      box-shadow: 0 0 10px rgba(124, 92, 255, 0.5);
    }

#extraOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 56px;
  bottom: 0;
  background: rgba(6, 7, 10, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 90;
  color: var(--text);
  flex-direction: column;
  padding: 32px 24px;
  width: 320px;
  border-right: 1px solid rgba(124, 92, 255, 0.1);
  box-shadow: 30px 0 60px rgba(0, 0, 0, 0.8);
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}


#extraOverlay[style*="display: flex"], 
#extraOverlay[style*="display:flex"] {
  transform: translateX(0);
  opacity: 1;
  animation: slideInExtra 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}


#extraOverlay.closing {
  animation: slideOutExtra 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#extraOverlay h2 {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 24px;
  text-shadow: 0 0 15px rgba(150, 120, 255, 0.8), 0 0 25px rgba(150, 120, 255, 0.4);
  letter-spacing: 0.5px;
}

#extraList {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

#extraList div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 19, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 14px 16px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

#extraList div:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

#extraList div span, 
#extraList div .title {
  flex: 1;
  margin-left: 14px;
  text-align: left;
  line-height: 1.3;
}

#extraList div svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  opacity: 0.8;
}

#extraList div button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

#extraList div button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

#extraOverlay > button {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: rgba(18, 19, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#extraOverlay > button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

@keyframes pulseLogo {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(124, 92, 255, 0.5)); }
  50% { filter: drop-shadow(0 0 22px rgba(124, 92, 255, 0.8)); transform: scale(1.02); }
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #10b981; }
  50% { opacity: 0.5; box-shadow: 0 0 4px #10b981; }
}

@keyframes slideInExtra {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutExtra {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}


@media (max-width: 768px) {
  #extraOverlay {
    width: calc(100vw - 56px); 
    padding: 24px 16px;
    border-right: none;
  }


  #extraList div {
    padding: 12px 14px;
    font-size: 13px;
  }
  
  #contentFrame {
    width: 83.33% !important;
    height: 83.33% !important;
    transform: scale(1.2) !important; 
    transform-origin: top left;
    max-width: 83.33% !important;
    max-height: 83.33% !important;
    -webkit-overflow-scrolling: touch;
  }

  #clock-container {
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    min-width: 120px;
  }

  #time-display {
    font-size: 20px;
  }

  #seconds-display {
    font-size: 11px;
  }
}
