/* Custom styles for 生活科技 Google AI 專題學習 互動教學網頁 */

/* Navigation Button Styling */
.nav-btn {
    display: inline-flex;
    items-center: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    font-size: 0.8125rem;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-btn.active {
    background-color: #ffffff;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Custom Hide Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Gadget Select Button Active State */
.gadget-btn.active {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Slide Card Hover Effects */
.slide-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.slide-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content:not(.hidden) {
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Print Styling for Portfolio Export */
@media print {
    header, footer, nav, .tab-btn, button, #slideModal {
        display: none !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    main {
        padding: 0 !important;
        max-width: 100% !important;
    }
    .tab-content {
        display: none !important;
    }
    #sec-portfolio {
        display: block !important;
    }
    #printablePortfolio {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* ====================================================
   Annotation Toolbar & Drawing Canvas CSS (DrawApp)
   ==================================================== */
#draw-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9990;
  pointer-events: none;
}
#text-annotation-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9991;
  pointer-events: none;
}

.annot-text-box {
  position: absolute;
  min-width: 90px;
  min-height: 34px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px dashed #007aff;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: bold;
  color: #111111;
  outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  cursor: move;
  line-height: 1.4;
  word-break: break-word;
}
.annot-text-box:focus {
  border-style: solid;
  border-color: #ff3b30;
  background: #ffffff;
}

#draw-toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  background: #282523;
  padding: 8px 14px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  user-select: none;
  white-space: nowrap;
  max-width: 95vw;
  overflow-x: auto;
}
#draw-toolbar.draw-toolbar-hidden {
  opacity: 0;
  transform: translate(-50%, 40px) scale(0.95);
  pointer-events: none;
}

#draw-master-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
#draw-master-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

.dt-btn {
  background: #393532;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e0dc;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.dt-btn:hover {
  background: #4a4541;
  color: #ffffff;
}
.dt-btn.active {
  background: #5c5550;
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dt-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

.dt-color-picker-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.dt-style-badge {
  background: #393532;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.dt-style-badge:hover {
  background: #4a4541;
}

.dt-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  display: inline-block;
}

.dt-style-menu {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: #201e1c;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px 14px;
  border-radius: 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 10000;
  min-width: 230px;
  white-space: nowrap;
}
.dt-style-menu.show {
  display: flex;
}
.dt-style-title {
  font-size: 0.8rem;
  color: #aaaaaa;
  font-weight: bold;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dt-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dt-color-option {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease;
}
.dt-color-option:hover, .dt-color-option.active {
  transform: scale(1.25);
  border-color: #ffffff;
}
.dt-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dt-slider-wrap input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  accent-color: #ff3b30;
  cursor: pointer;
}
.dt-preset-row {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}
.dt-preset-btn {
  background: #393532;
  border: 1px solid rgba(255,255,255,0.12);
  color: #e5e0dc;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.15s ease;
}
.dt-preset-btn:hover, .dt-preset-btn.active {
  background: #5c5550;
  color: #ffffff;
  border-color: #ffffff;
}

/* Shake Animation for Password Lock Modal */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.animate-shake {
  animation: shake 0.4s ease-in-out;
}

