/* 基本樣式設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

:root {
    --primary: #2C3E50;
    --secondary: #3498DB;
    --accent: #E74C3C;
    --light: #ECF0F1;
    --dark: #2C3E50;
    --success: #2ECC71;
    --warning: #F39C12;
}

body {
    background-color: #f5f5f5;
    color: var(--dark);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 頁首樣式 */
header {
    background-color: var(--primary);
    color: white;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

/* 主內容區域樣式 */
#page-container {
    min-height: calc(100vh - 120px);
    /* 頭部和底部導航的高度 */
    padding-bottom: 60px;
    /* 為底部導航欄留出空間 */
}

.page-content {
    padding: 20px;
}

.section-title {
    margin: 25px 0 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

.section-title:first-child {
    margin-top: 0;
}

/* 首頁樣式 */
.hero-section {
    position: relative;
    height: 180px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 10px;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    background-color: var(--light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-item:hover {
    background-color: #dce1e3;
}

.action-icon {
    width: 40px;
    height: 40px;
    background-color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    color: white;
}

.action-text {
    font-size: 0.8rem;
}

.class-list {
    margin-bottom: 20px;
}

.class-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    cursor: pointer;
}

.class-time {
    background-color: var(--primary);
    color: white;
    padding: 5px;
    border-radius: 5px;
    font-size: 0.8rem;
    width: 60px;
    text-align: center;
    margin-right: 15px;
}

.class-details {
    flex-grow: 1;
}

.class-title {
    font-weight: bold;
    margin-bottom: 3px;
}

.class-instructor {
    font-size: 0.8rem;
    color: #777;
}

.statistics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-title {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* 訓練頁面樣式 */
.workout-menu {
    display: flex;
    background-color: var(--light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.workout-menu-item {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.workout-menu-item.active {
    background-color: var(--secondary);
    color: white;
}

.workout-plan-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 15px;
}

.workout-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.workout-plan-title {
    font-weight: bold;
    font-size: 1.1rem;
}

.workout-plan-tag {
    background-color: var(--light);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
}

.workout-plan-tag.current {
    background-color: var(--success);
    color: white;
}

.workout-plan-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.workout-plan-stats {
    display: flex;
    margin-bottom: 15px;
}

.workout-plan-stat {
    flex: 1;
    text-align: center;
    padding: 5px;
    border-right: 1px solid #eee;
}

.workout-plan-stat:last-child {
    border-right: none;
}

.workout-plan-stat-value {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--secondary);
}

.workout-plan-stat-label {
    font-size: 0.7rem;
    color: #666;
}

.workout-plan-progress {
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.workout-plan-progress-bar {
    height: 100%;
    background-color: var(--success);
}

.workout-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    overflow: hidden;
}

.workout-card-header {
    display: flex;
    padding: 15px;
    background-color: var(--primary);
    color: white;
}

.workout-day {
    width: 60px;
    text-align: center;
    margin-right: 15px;
}

.workout-day-num {
    font-size: 1.5rem;
    font-weight: bold;
}

.workout-day-text {
    font-size: 0.8rem;
}

.workout-info {
    flex-grow: 1;
}

.workout-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.workout-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
}

.workout-card-body {
    padding: 15px;
}

.exercise-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.exercise-item:last-child {
    border-bottom: none;
}

.exercise-icon {
    width: 40px;
    height: 40px;
    background-color: var(--light);
    border-radius: 10px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.exercise-details {
    flex-grow: 1;
}

.exercise-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.exercise-sets {
    font-size: 0.8rem;
    color: #666;
}

.exercise-toggle {
    width: 24px;
    height: 24px;
    background-color: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 8px;
}

.exercise-toggle.completed {
    background-color: var(--success);
    color: white;
}

.workout-history {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    /* 讓iOS上滾動更流暢 */
}

.history-day {
    flex: 0 0 auto;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 10px;
}

.history-day-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.8rem;
}

.history-day-text {
    font-size: 0.7rem;
    color: #666;
}

.history-day-circle.completed {
    background-color: var(--success);
    color: white;
}

.history-day-circle.active {
    background-color: var(--secondary);
    color: white;
}

.history-day-circle.empty {
    background-color: var(--light);
}

.set-history-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.set-history-num {
    width: 25px;
    height: 25px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 10px;
}

.set-history-details {
    flex-grow: 1;
}

.set-history-stats {
    display: flex;
    font-size: 0.9rem;
}

.set-history-stat {
    margin-right: 15px;
}

.set-history-label {
    color: #666;
    font-size: 0.7rem;
}

/* 器材使用頁面樣式 */
.equipment-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.equipment-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.equipment-image {
    height: 120px;
    background-color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equipment-info {
    padding: 10px;
}

.equipment-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.equipment-usage {
    font-size: 0.7rem;
    color: #666;
}

.equipment-status {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-top: 5px;
}

.equipment-availability {
    padding: 2px 6px;
    border-radius: 10px;
    background-color: var(--success);
    color: white;
}

.equipment-availability.busy {
    background-color: var(--accent);
}

/* 數據頁面樣式 */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats-period-selector {
    display: flex;
    background-color: var(--light);
    border-radius: 20px;
    overflow: hidden;
}

.stats-period {
    padding: 5px 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

.stats-period.active {
    background-color: var(--secondary);
    color: white;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stats-card {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.stats-card-icon {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.stats-card-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-card-label {
    font-size: 0.7rem;
    color: #666;
}

.stats-card-change {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.stats-card-change.positive {
    color: var(--success);
}

.stats-card-change.negative {
    color: var(--accent);
}

.stats-chart-container {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.stats-chart-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
}

.stats-chart-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.personal-records {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.record-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.record-item:last-child {
    border-bottom: none;
}

.record-name {
    flex: 1;
    font-weight: bold;
}

.record-value {
    flex: 1;
    text-align: center;
    color: var(--secondary);
    font-weight: bold;
}

.record-date {
    flex: 1;
    text-align: right;
    font-size: 0.8rem;
    color: #666;
}

.goals-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 20px;
}

.goal-item {
    margin-bottom: 15px;
}

.goal-item:last-child {
    margin-bottom: 0;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.goal-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.goal-progress-text {
    font-size: 0.8rem;
    color: var(--secondary);
}

.goal-progress-bar {
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.goal-progress-filled {
    height: 100%;
    background-color: var(--success);
}

/* 社群頁面樣式 */
.community-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.community-search {
    display: flex;
    align-items: center;
    background-color: var(--light);
    border-radius: 20px;
    padding: 5px 15px;
    margin-top: 10px;
}

.search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    outline: none;
}

.search-icon {
    margin-left: 10px;
}

.events-container {
    margin-bottom: 20px;
}

.event-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    overflow: hidden;
}

.event-image {
    position: relative;
    height: 150px;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-date {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: white;
    border-radius: 10px;
    padding: 5px 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.event-date-day {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.2;
}

.event-date-month {
    font-size: 0.8rem;
    color: #666;
}

.event-info {
    padding: 15px;
}

.event-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.event-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.event-participants {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.event-participants-avatars {
    display: flex;
}

.avatar {
    width: 25px;
    height: 25px;
    background-color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    margin-right: -5px;
}

.event-participants-count {
    font-size: 0.8rem;
    color: #666;
}

.challenges-container {
    margin-bottom: 20px;
}

.challenge-card {
    display: flex;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 15px;
}

.challenge-icon {
    width: 50px;
    height: 50px;
    background-color: var(--light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 15px;
}

.challenge-info {
    flex-grow: 1;
}

.challenge-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.challenge-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
}

.challenge-progress-bar {
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    margin-bottom: 5px;
    overflow: hidden;
}

.challenge-progress-filled {
    height: 100%;
    background-color: var(--success);
}

.challenge-progress-text {
    text-align: right;
    font-size: 0.7rem;
    color: #666;
}

.friends-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.friend-row {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.friend-row:last-child {
    border-bottom: none;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.friend-info {
    flex-grow: 1;
}

.friend-name {
    font-weight: bold;
    margin-bottom: 3px;
}

.friend-status {
    font-size: 0.8rem;
    color: #666;
}

.friend-message-btn {
    width: 32px;
    height: 32px;
    background-color: var(--light);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
}

.forum-container {
    margin-bottom: 20px;
}

.forum-post {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 15px;
}

.forum-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.forum-post-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.forum-post-info {
    flex-grow: 1;
}

.forum-post-author {
    font-weight: bold;
}

.forum-post-time {
    font-size: 0.8rem;
    color: #666;
}

.forum-post-text {
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.forum-post-actions {
    display: flex;
    margin-top: 10px;
}

.forum-action {
    margin-right: 15px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
}

/* 底部導航欄樣式 */
.tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    margin: 0 auto;
    z-index: 90;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    cursor: pointer;
}

.tab-item.active {
    color: var(--secondary);
}

.tab-icon {
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.tab-text {
    font-size: 0.7rem;
}

/* 模態框樣式 */
#modals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
    pointer-events: auto;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.btn {
    display: block;
    padding: 12px;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-full {
    width: 100%;
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}
