@import url('https://fonts.googleapis.com/css2?family=Changa+One:ital@0;1&family=Chewy&display=swap');


.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100000000;
    justify-content: center;
    align-items: center;
}

/* 添加canvas-confetti相關樣式 */
canvas {
    position: fixed !important;
    z-index: 2000 !important;
    pointer-events: none !important;
}

.popup-content {
    background: url('../images/mailbg.png') no-repeat center center;
    background-size: 100% 100%;
    width: 90%;
    max-width: 850px;
    position: relative;
    padding: 40px;
    border-radius: 20px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s, transform 0.3s;
	top: 10%;
    left: 5%;
}

.popup-header {
    font-style: normal;
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
}

.popup-header h2 {
    font-family: 'Changa One', cursive;
    font-weight: 400;
    font-size: 2.8rem;
    color: #5c3c10;
    font-weight: bold;
    text-align: center;
    text-shadow: 0px 5px 0px #b1956f;
}

.close-btn {
    position: absolute;
    top: -10px;
    right: -10%;
    font-size: 40px;
    color: #5c3c10;
    cursor: pointer;
    background: url('../images/cross.png') no-repeat center center;
    background-size: contain;
    width: 80px;
    height: 80px;
}

/* 任務列表容器樣式 */
.mission-list-container {
    max-height: 400px; /* 設定固定高度 */
    overflow-y: auto; /* 當內容超出高度時顯示垂直滾動條 */
    margin-bottom: 20px;
    padding-right: 10px; /* 為滾動條預留空間 */
}

/* 自定義滾動條樣式 */
.mission-list-container::-webkit-scrollbar {
    width: 8px;
}

.mission-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.mission-list-container::-webkit-scrollbar-thumb {
    background: rgba(92, 60, 16, 0.5);
    border-radius: 10px;
}

.mission-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(92, 60, 16, 0.8);
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mission-item {
    background-color: transparent;
    overflow: hidden;
    transition: transform 0.3s;
    cursor: pointer;
}

.mission-item:hover {
    transform: translateY(-5px);
}

.mission-thumbnail {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 35px;
}

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

.mission-status {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: 'Chewy', cursive;
    font-size: 2.3rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 2;
}

.mission-status::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 35px;
    z-index: -1;
    padding: 50px;
}

.mission-status.done {
    color: white;
}

.mission-status.done::after {
    background-color: rgb(92 165 8 / 60%);
    width: 150px;
    height: 150px;
}

.mission-status.pending {
    color: white;
}

.mission-status.pending::after {
    background-color: rgb(255 0 0 / 48%);
    width: 150px;
    height: 150px;
}

.mission-coins {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    border-radius: 15px;
    padding: 5px 10px;
    color: white;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 2rem;
    font-family: 'Chewy', cursive;
    letter-spacing: 3px;
}

.mission-coins img {
    width: 40px;
    height: 40px;
    margin-right: 5px;
}

.mission-title {
    font-family: 'Chewy', cursive;
    text-align: center;
    color: #333;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 1px;
    height: 60px;
    overflow: auto;
}

/* 任務狀態的不同樣式 */
.mission-item:nth-child(odd) .mission-thumbnail {
    background-color: rgba(0, 128, 0, 0.3);
}

.mission-item:nth-child(even) .mission-thumbnail {
    background-color: rgba(220, 20, 60, 0.3);
}

/* 任務詳情視圖樣式 */
.mission-detail {
    width: 100%;
}

.mission-detail-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mission-detail-header {
    text-align: center;
    width: 100%;
}

.mission-detail-header h3 {
    font-family: 'Chewy', cursive;
    font-size: 2.5rem;
    color: #333;
}

.mission-detail-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: end;
    width: 100%;
    padding: 0 20px;
}

.mission-detail-author, .mission-detail-date {
    font-family: 'Chewy', cursive;
    font-size: 1.3rem;
    color: #000
}

.mission-detail-body {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.mission-detail-body p {
    font-family: 'Chewy', cursive;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 20px;
    align-self: flex-start;
}

.mission-detail-image {
    width: 250px;
    height: auto;
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 30px;
}

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

.mission-detail-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    position: absolute;
    bottom: -4%;
    gap: 10px;
    width: 100%;
}

.finish-button {
    background: url('../images/button-green.png') no-repeat center center;
    background-size: 100% 100%;
    width: 200px;
    height: 80px;
    border: none;
    cursor: pointer;
    font-family: 'Chewy', cursive;
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.finish-button:hover {
    transform: scale(1.05);
}

.back-button {
    background: url(../images/button-green.png) no-repeat center center;
    background-size: 100% 100%;
    width: 200px;
    height: 80px;
    border: none;
    cursor: pointer;
    font-family: 'Chewy', cursive;
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    filter: hue-rotate(126deg);
}

.back-button:hover {
   transform: scale(1.05);
}

/* 任務完成視圖樣式 */
.mission-complete {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.mission-complete-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

.mission-complete-family {
    width: 100%;
    height: 450px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.mission-complete-family img {
    height: 100%;
}

.well-done-text {
    position: absolute;
    top: 47%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Chewy', cursive;
    font-size: 5rem;
    color: #FF6B00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.tell-parent-text {
    position: absolute;
    top: -3%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Chewy', cursive;
    font-size: 2rem;
    color: #ff5722;
    white-space: nowrap;
    text-align: center;
}

.mission-complete-reward {
    position: absolute;
    bottom: 20%;
    right: 10%;
    display: flex;
    align-items: center;
}

.mission-complete-reward img {
    width: 60px;
    height: 60px;
}

.coin-count {
    font-family: 'Chewy', cursive;
    font-size: 3rem;
    color: #000;
    margin-left: 5px;
}

.coin-note {
    position: absolute;
    top: 100%;
    right: 0;
    font-family: 'Chewy', cursive;
    font-size: 1.3rem;
    color: #0066CC;
    white-space: nowrap;
}

.done-button {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: url('../images/button-green.png') no-repeat center center;
    background-size: 100% 100%;
    width: 200px;
    height: 80px;
    border: none;
    cursor: pointer;
    font-family: 'Chewy', cursive;
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.done-button:hover {
    transform: translateX(-50%) scale(1.05);
}

/* 過濾按鈕樣式 */
.mission-filter-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-button {
    background: url('../images/button-green.png') no-repeat center center;
    background-size: 100% 100%;
    width: 150px;
    height: 60px;
    border: none;
    cursor: pointer;
    font-family: 'Chewy', cursive;
    font-size: 1.5rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    opacity: 0.7;
}

.filter-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.filter-button.active {
    opacity: 1;
    transform: scale(1.05);
}

/* 響應式設計 */
@media (max-width: 900px) {
    .mission-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mission-list-container {
        max-height: 350px; /* 調整較小屏幕的高度 */
    }
    
    .mission-detail-image {
        height: 200px;
    }
    
    .well-done-text {
        font-size: 3.5rem;
    }
    
    .tell-parent-text {
        font-size: 1.3rem;
        top: 63%;
    }
    
    .mission-complete-reward {
        right: 5%;
    }
    
    .coin-count {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .mission-grid {
        grid-template-columns: 1fr;
    }
    
    .mission-list-container {
        max-height: 300px; /* 調整更小屏幕的高度 */
    }
    
    .popup-content {
        padding: 20px;
    }
    
    .mission-detail-header h3 {
        font-size: 1.8rem;
    }
    
    .mission-detail-body p {
        font-size: 1.4rem;
    }
    
    .finish-button {
        width: 150px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .well-done-text {
        font-size: 2.5rem;
    }
    
    .tell-parent-text {
        font-size: 1.1rem;
        top: 60%;
    }
    
    .mission-complete-reward img {
        width: 40px;
        height: 40px;
    }
    
    .coin-count {
        font-size: 2rem;
    }
    
    .done-button {
        width: 150px;
        height: 60px;
        font-size: 1.8rem;
    }
} 