﻿/* ============================================
   UI polish layer: shared radii, touch feedback, mobile motion
   Loaded after feature styles so it can normalize page-level details.
   ============================================ */

:root {
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --motion-fast: 160ms;
  --motion-base: 240ms;
  --motion-slow: 360ms;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tools-search-bar,
.bottom-nav,
#floorBar,
#indoorLegend,
.modal-content,
.app-download-drawer,
.score-eval-warning-dialog,
.course-detail-modal,
.official-links-card {
  border-radius: var(--radius-xl);
}

.weather-island {
  border-radius: var(--radius-pill);
}

.weather-island.expanded {
  border-radius: 28px;
}

.page-overlay {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.tool-btn,
.tool-btn.qq-channel-row-btn,
.study-feature-panel,
.study-simple-card,
.study-schedule-card,
.score-section,
.score-stat-card,
.training-plan-card,
.energy-card,
.campus-card-panel,
.eat-card,
.room-card,
.calendar-card,
.activity-card,
.club-card,
.hometown-card,
.station-card,
.weather-card,
.option-card {
  border-radius: var(--radius-lg) !important;
}

button,
.glass-btn,
.sub-page-back,
.schedule-header-btn,
.tool-btn-action-badge,
.official-link-button,
input,
select,
textarea {
  border-radius: var(--radius-md);
}

.bottom-nav,
.location-btn,
#floorBar,
.weather-island,
.tools-search-bar,
.tool-btn,
.study-feature-panel,
.study-simple-card,
.study-schedule-card,
.sub-page-back,
.official-link-row {
  transition-duration: var(--motion-base);
  transition-timing-function: var(--ease-standard);
}


/* Restore the original springy title island behavior after generic motion rules. */
.weather-island {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-radius 0.35s ease,
              background 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Community activities page: make small controls match the softer global radius. */
#activities-page .community-view-tabs {
  border-radius: 12px;
  padding: 4px;
}

#activities-page .community-view-tab {
  border-radius: 8px;
  transition: transform var(--motion-fast) var(--ease-standard),
              background-color var(--motion-base) ease,
              box-shadow var(--motion-base) ease,
              color var(--motion-base) ease;
}

#activities-page .community-view-tab:active {
  transform: scale(0.96);
}

#activities-page .club-row,
#activities-page .activity-section-card {
  border-radius: 16px !important;
}

#activities-page .club-logo,
#activities-page .activity-action-btn,
#activities-page .life-activity-stat {
  border-radius: 8px !important;
}

#activities-page .club-logo {
  border-radius: 50% !important;
}

#activities-page .club-category,
#activities-page .club-promotion-btn {
  border-radius: 8px !important;
}

#activities-page .club-resident-badge {
  border-radius: 12px 0 12px 0 !important;
}

#activities-page .club-row .club-resident-badge {
  left: 8px !important;
  right: auto !important;
  top: 8px !important;
}

#activities-page .club-row.promoted .club-title-line {
  padding-left: 0 !important;
}

#activities-page .club-row,
#activities-page .activity-section-card,
#activities-page .activity-action-btn,
#activities-page .club-promotion-btn {
  transition: transform var(--motion-fast) var(--ease-standard),
              background-color var(--motion-base) ease,
              border-color var(--motion-base) ease,
              box-shadow var(--motion-base) ease;
}

#activities-page .club-row:active,
#activities-page .activity-section-card:active {
  transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
  #activities-page .club-row:hover,
  #activities-page .activity-section-card:hover {
    transform: translateY(-2px);
  }
}
.bottom-nav {
  animation: uiFloatIn var(--motion-slow) var(--ease-spring) both;
}

.location-btn {
  animation: uiFloatInCorner var(--motion-slow) var(--ease-spring) 80ms both;
}

.bottom-nav-item i,
.tool-btn img,
.study-feature-img,
.sub-page-back i,
.schedule-header-btn i {
  transition: transform var(--motion-base) var(--ease-spring), opacity var(--motion-base) ease;
}

.bottom-nav-item.active i {
  transform: translateY(-1px) scale(1.08);
}

.bottom-nav-item:active i,
.tool-btn:active img,
.sub-page-back:active i,
.schedule-header-btn:active i {
  transform: scale(0.9);
}

.tool-btn,
.study-feature-panel,
.study-simple-card,
.study-schedule-card {
  transform-origin: center;
}

.tool-btn:active,
.study-feature-action:active,
.study-tool-button:active,
.official-link-row:active {
  transform: scale(0.96);
}

.tools-sub-page.active {
  animation: pageEnter var(--motion-slow) var(--ease-standard) both;
}

.tools-home-grid > *,
.study-top-grid > *,
.tools-grid-section > *,
.tools-grid-section-secondary > * {
  animation: cardRise var(--motion-slow) var(--ease-standard) both;
}

.tools-home-grid > *:nth-child(2n),
.tools-grid-section > *:nth-child(2n) {
  animation-delay: 35ms;
}

.tools-home-grid > *:nth-child(3n),
.tools-grid-section > *:nth-child(3n) {
  animation-delay: 70ms;
}

.weather-island.reminder-mode {
  animation: reminderPulse 2s ease-in-out infinite, softNudge 3.2s ease-in-out infinite;
}

.drawer-hint-bar {
  animation: handleBreath 2.6s ease-in-out infinite;
}

@media (hover: hover) and (pointer: fine) {
  .tool-btn:hover,
  .study-feature-panel:hover,
  .study-simple-card:hover,
  .study-schedule-card:hover,
  .tools-search-bar:hover,
  .official-link-row:hover {
    transform: translateY(-2px);
  }

  .tool-btn:hover img,
  .study-feature-panel:hover .study-feature-img {
    transform: scale(1.07) rotate(1deg);
  }
}

@media (max-width: 480px) {
  .tools-home-grid {
    gap: 12px;
  }

  .tool-btn,
  .study-feature-panel,
  .study-simple-card,
  .study-schedule-card {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .bottom-nav {
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@keyframes uiFloatIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes uiFloatInCorner {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softNudge {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -1px; }
}

@keyframes handleBreath {
  0%, 100% { opacity: 0.55; transform: scaleX(1); }
  50% { opacity: 0.95; transform: scaleX(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
