:root {
    --primary: #4a6fa5;
    --secondary: #6b8cbc;
    --accent: #ff7e5f;
    --light: #f8f9fa;
    --dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --radius: 10px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
}

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: white;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
}

.logo i {
    font-size: 28px;
    color: var(--primary);
    margin-right: 10px;
}

.logo h1 {
    color: var(--primary);
    font-size: 22px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    color: white;
    position: relative;
    /* Background image: place your image file next to index.html as `hero-bg.jpg`
       or update the URL below to point to your preferred image. */
    background-image: url('../Component/assets/images/background.jpg');
    background-repeat: no-repeat;
    background-size: cover;               /* cover ensures the image fills the area */
    /* keep the bottom of the image visible by biasing position toward bottom */
    background-position: center bottom;  /* try `center 85%` to fine-tune if needed */
    background-attachment: scroll; /* avoid fixed behavior on mobile browsers */
}

/* dark overlay so text remains readable on top of the image */
.hero::before {
    content: '';
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: linear-gradient(180deg, rgba(10,20,35,0.45), rgba(10,20,35,0.45));
    pointer-events: none;
    z-index: 0;
}

.hero > * {
    position: relative; /* bring text/content above overlay */
    z-index: 1;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
}

.btn:hover {
    background-color: #ff6a4a;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    margin-left: 10px;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.features {
    padding: 60px 20px;
    background-color: white;
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--dark);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--dark);
}

.feature-card p {
    color: #6c757d;
}

.testimonials {
    padding: 60px 20px;
    background-color: #f8f9fa;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.testimonial-card {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
    color: #6c757d;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.author-info h4 {
    margin-bottom: 5px;
}

.author-info p {
    color: #6c757d;
    font-size: 14px;
}

.footer {
    background-color: var(--dark);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    list-style: none;
    margin-bottom: 20px;
}

.footer-links li {
    margin: 0 15px;
}

.footer-links a {
    color: white;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.copyright {
    color: #adb5bd;
    font-size: 14px;
}

/* Login/Register Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    width: 420px;
    max-width: 92vw;
    max-height: 80vh;       /* 整體視窗高度上限 */
    overflow: hidden;       /* 外層不滾動，內層處理 */
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
}

/* 標籤區與按鈕置頂，內容區滾動 */
.modal-tabs {
    display: flex;
    flex-direction: row;       /* 同一列 */
    align-items: center;
    justify-content: center;   /* 置中，可改為 space-between */
    gap: 8px;
    padding: 8px 16px 0 16px;
    border-bottom: 1px solid #eef2f6;
}

.tab {
    padding: 8px 18px;
    cursor: pointer;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    background: transparent;
    transition: background-color 0.15s, color 0.15s, transform 0.12s;
    user-select: none;
}

.tab:hover {
    background: rgba(0,0,0,0.03);
    transform: translateY(-1px);
}

.tab.active {
    color: var(--primary);
    background: #fff;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 -2px 0 rgba(0,0,0,0.02) inset;
}

/* 若 modal-content 背景非白會看不出 active 背景，可加上 */
.modal-content { background: #fff; }

.tab-content {
    display: none;                     /* hide by default */
    padding: 12px 16px;
    box-sizing: border-box;
    overflow: auto;
    max-height: calc(80vh - 140px);
}

/* show active tab as flex so it fills modal content area */
.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 12px 16px;
    overflow: auto;
    max-height: calc(80vh - 140px);
}

.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9dfe6;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border 0.3s;
}

/* 修改：讓 select（例如性別下拉）與其他輸入欄位樣式一致 */
select,
textarea,
input[type="date"],
input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9dfe6;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border 0.3s;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 36px; /* 留空間給自訂下拉箭頭 */
}

/* 自訂下拉箭頭（純 CSS）*/
select {
    background-image:
      linear-gradient(45deg, transparent 50%, #6c757d 50%),
      linear-gradient(135deg, #6c757d 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 6px), calc(100% - 12px) calc(50% - 6px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

/* focus 樣式與 input 保持一致 */
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* features / testimonials 固定高度並可滾动（列表） */
.features-grid,
.testimonial-grid {
    max-height: 340px;   /* 固定顯示長度，可調整數值 */
    overflow: auto;
    padding-right: 8px;  /* 留出滾動條空間，避免覆蓋內容 */
}

/* 微調網格顯示，避免在滾動時 layout 跳動 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.testimonial-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 小螢幕優化 */
@media (max-width: 480px) {
    .modal-content { width: 92vw; max-height: 86vh; }
    .features-grid, .testimonial-grid { max-height: 260px; }
    /* Make hero smaller on narrow viewports and adjust text sizes */
    .hero {
        padding: 28px 16px;
        /* bias the focal point toward the bottom on phones so the foot area is visible */
        background-position: center bottom;
        min-height: 60vh; /* give more vertical room to show image bottom */
    }
    .hero h2 { font-size: 26px; }
    .hero p { font-size: 15px; max-width: 90%; }
}

@media (min-width: 1200px) {
    /* on very wide screens, ensure hero still looks good */
    .hero { padding: 80px 20px; min-height: 68vh; }
    .hero h2 { font-size: 48px; }
}

