/* Ask My HR - 修復版基礎樣式 */
/* Mobile-First Responsive Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 🎯 修復的Header & Navigation */
header {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 70px;
    position: relative;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.025em;
    z-index: 1001;
}

.logo:hover {
    color: #1d4ed8;
}

/* 🎯 修復的Desktop Navigation */
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
    position: relative;
    z-index: 1000;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    white-space: nowrap;
}

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

.nav-links a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

/* 🎯 修復的CTA Button */
.cta-button {
    background: var(--primary-color) !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    margin-left: 1rem;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
}

.cta-button:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Burger Menu - 桌面隱藏 */
.burger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

/* 🔥 DESKTOP 修復 (1025px及以上) - 主要修復區域 */
@media (min-width: 1025px) {
    /* Header高度調整 */
    header {
        height: 80px; /* 增加header高度 */
    }
    
    nav {
        min-height: 80px;
        height: 80px;
    }
    
    /* Main content調整 */
    main {
        margin-top: 80px !important; /* 與header高度匹配 */
    }
    
    /* 🔥 Hero Section - 大幅增加間距 */
    .hero {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        color: white;
        padding: 8rem 0 4rem 0 !important; /* 從4rem增加到8rem */
        text-align: center;
        position: relative;
        z-index: 1;
        margin-top: 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        margin-top: 1rem; /* 額外頂部間距 */
        font-weight: 600;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.25rem;
        margin-bottom: 2rem;
        opacity: 0.9;
        line-height: 1.6;
    }
    
    .hero-image {
        max-width: 100%;
        height: auto;
        margin: 3rem 0;
        border-radius: 1rem;
    }
    
    /* 確保navigation正常顯示 */
    .burger-menu {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
        position: static !important;
        transform: none !important;
        background: transparent !important;
        flex-direction: row !important;
        height: auto !important;
        width: auto !important;
        box-shadow: none !important;
    }
}

/* 🔥 IPAD 修復 (768px - 1024px) - 主要修復區域 */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Header高度調整 */
    header {
        height: 85px; /* iPad用更高的header */
    }
    
    nav {
        min-height: 85px;
        height: 85px;
        padding: 1rem 2rem;
    }
    
    /* Main content調整 */
    main {
        margin-top: 85px !important; /* 與header高度匹配 */
    }
    
    /* 🔥 Hero Section - 大幅增加間距 */
    .hero {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        color: white;
        padding: 10rem 0 4rem 0 !important; /* iPad用最大間距 */
        text-align: center;
        position: relative;
        z-index: 1;
        margin-top: 0;
    }
    
    .hero h1 {
        font-size: 2.25rem;
        margin-bottom: 1.5rem;
        margin-top: 1.5rem; /* 額外頂部間距 */
        font-weight: 600;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
        opacity: 0.9;
        line-height: 1.6;
    }
    
    .hero-image {
        max-width: 100%;
        height: auto;
        margin: 2rem 0;
        border-radius: 1rem;
    }
    
    /* 確保顯示desktop navigation */
    .burger-menu {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
        position: static !important;
        transform: none !important;
        background: transparent !important;
        flex-direction: row !important;
        height: auto !important;
        width: auto !important;
        padding: 0 !important;
        box-shadow: none !important;
        gap: 1.5rem; /* iPad用稍小的gap */
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 0.5rem 0.5rem;
    }
    
    .cta-button {
        padding: 0.7rem 1.2rem !important;
        font-size: 0.85rem !important;
        margin-left: 0.5rem;
    }
}

/* 🔥 iPhone 和小屏設備 (767px以下) - 保持原樣 */
@media (max-width: 767px) {
    /* Header調整 */
    header {
        height: 65px;
    }
    
    nav {
        padding: 0.75rem 1rem;
        min-height: 65px;
    }
    
    .logo {
        font-size: 1.4rem;
        z-index: 1001;
    }
    
    /* Main content調整 */
    main {
        margin-top: 65px;
    }
    
    /* 🔥 iPhone Hero - 保持原有間距 */
    .hero {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        color: white;
        padding: 4rem 0 3rem 0; /* iPhone保持原有間距 */
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* 🔥 Burger Menu顯示與樣式 */
    .burger-menu {
        display: block !important;
        position: relative;
        width: 60px !important;
        height: 60px !important;
        padding: 15px !important;
        background: rgba(0,0,0,0.05) !important;
        border: 2px solid transparent !important;
        border-radius: 12px !important;
        z-index: 1001 !important;
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.3) !important;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
        cursor: pointer;
        pointer-events: auto !important;
    }
    
    /* Burger 線條 */
    .burger-line {
        display: block !important;
        width: 30px !important;
        height: 4px !important;
        background: #333 !important;
        margin: 6px 0 !important;
        border-radius: 2px;
        transition: all 0.3s ease;
        pointer-events: none;
    }
    
    /* 點擊反饋 */
    .burger-menu:active {
        background: rgba(37, 99, 235, 0.2) !important;
        border-color: #2563eb !important;
    }
    
    /* 激活狀態的動畫 */
    .burger-menu.active .burger-line:nth-child(1) {
        transform: rotate(-45deg) translate(-8px, 6px);
        background: #2563eb !important;
    }
    
    .burger-menu.active .burger-line:nth-child(2) {
        opacity: 0;
    }
    
    .burger-menu.active .burger-line:nth-child(3) {
        transform: rotate(45deg) translate(-8px, -6px);
        background: #2563eb !important;
    }
    
    /* Mobile Menu */
    .nav-links {
        position: fixed !important;
        top: 65px;
        left: 0;
        width: 100vw !important;
        height: calc(100vh - 65px) !important;
        background: white;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 菜單顯示 */
    .nav-links.active {
        transform: translateX(0);
    }
    
    /* 菜單項目 */
    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-links a {
        display: block;
        padding: 1.5rem 2rem;
        font-size: 1.2rem;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        width: 100%;
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
        touch-action: manipulation;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-links a:hover,
    .nav-links a:active {
        background: #f8fafc;
        color: #2563eb;
    }
    
    .cta-button {
        margin: 2rem auto 0;
        display: block;
        width: fit-content;
        padding: 1rem 2rem;
        background: #2563eb;
        color: white;
        border-radius: 8px;
        font-weight: 600;
        font-size: 1rem;
        text-decoration: none;
        border: none;
        min-height: 50px;
    }
    
    /* 防止背景滾動 */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
    }
}

/* 🎯 修復的Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    line-height: 1.5;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white !important;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
    background: #9ca3af !important;
    border-color: #9ca3af !important;
    color: white !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white !important;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white !important;
    border: 2px solid var(--success-color);
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
    color: white !important;
}

.btn-warning {
    background: var(--warning-color);
    color: white !important;
    border: 2px solid var(--warning-color);
}

.btn-warning:hover {
    background: #b45309;
    border-color: #b45309;
    color: white !important;
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* 🎯 修復的Chatbot Styles */
.chatbot-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background: var(--primary-color);
    color: white !important;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}

.message.bot {
    background: white;
    border: 1px solid var(--border-color);
    margin-right: auto;
    border-bottom-left-radius: 0.25rem;
    color: var(--text-dark) !important;
}

.message.system {
    background: #eff6ff;
    border: 1px solid var(--primary-color);
    margin: 0 auto;
    text-align: center;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    max-width: 90%;
}

.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.chat-input-group {
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    resize: none;
    min-height: 50px;
    max-height: 100px;
}

/* 🎯 修復的Chat Send Button */
.chat-send-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white !important;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.chat-send-btn:hover:not(:disabled) {
    background: #1d4ed8;
    color: white !important;
    transform: translateY(-1px);
}

.chat-send-btn:disabled {
    background: #9ca3af !important;
    color: white !important;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    margin-right: auto;
    max-width: 80px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Pricing Tables */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.pricing-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.pricing-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.pricing-card.featured::before {
    content: "Most Popular";
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.price-period {
    font-size: 1rem;
    color: var(--text-light);
}

.features {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
}

.features li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 2rem;
}

.features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid;
}

.alert-info {
    background: #eff6ff;
    border-color: var(--primary-color);
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-success {
    background: #ecfdf5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border-color: var(--error-color);
    color: #991b1b;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--text-dark);
    color: white;
    padding: 1rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1002;
}

.skip-link:focus {
    top: 0;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Responsive Design - 保持iPhone樣式不變 */
@media (max-width: 767px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .section {
        padding: 2rem 0;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .message {
        max-width: 95%;
    }
}
