/* ========================================
   台灣樂透網路有限公司 — 藍色系主題
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
    --primary-dark: #1a237e;
    --primary: #1565c0;
    --primary-light: #1e88e5;
    --accent: #ffd54f;
    --bg-light: #e3f2fd;
    --bg-white: #ffffff;
    --text-dark: #212121;
    --text-light: #ffffff;
    --text-muted: #607d8b;
    --shadow: 0 4px 20px rgba(26, 35, 126, 0.15);
    --shadow-hover: 0 8px 30px rgba(26, 35, 126, 0.25);
    --transition: all 0.3s ease;
}

/* ---------- Global ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
}

body {
    font-family: 'Microsoft JhengHei', 'Noto Sans TC', 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.8;
}

section {
    padding: 80px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin-top: 8px;
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

/* ---------- Navbar ---------- */
.navbar {
    padding: 12px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(26, 35, 126, 0.97) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    transition: var(--transition);
    position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--accent) !important;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
    transform: translateX(-50%);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 70%;
}

/* ---------- Hero Section ---------- */
#home {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

#home::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 213, 79, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-light);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-btn {
    background: var(--accent);
    color: var(--primary-dark);
    border: none;
    padding: 14px 36px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    transition: var(--transition);
    text-decoration: none;
}

.hero-btn:hover {
    background: #ffca28;
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 213, 79, 0.4);
}

/* ---------- Advantage Cards ---------- */
.advantage-cards {
    margin-top: 4rem;
}

.advantage-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 30px 24px;
    text-align: center;
    color: var(--text-light);
    transition: var(--transition);
}

.advantage-card:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-5px);
}

.advantage-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.advantage-card h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.advantage-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
}

/* ---------- About Section ---------- */
#about {
    background: var(--bg-white);
}

.about-story {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 2;
}

.about-highlight {
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
}

.about-highlight p {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--primary-dark);
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-light));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    padding-right: 40px;
    text-align: right;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-left: 40px;
}

.timeline-dot {
    position: absolute;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-white);
    box-shadow: 0 0 0 3px var(--primary);
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}

.timeline-year {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.timeline-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- Services Section ---------- */
#services {
    background: var(--bg-light);
}

.service-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--text-light);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-card h4 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- Portfolio Section ---------- */
#portfolio {
    background: var(--bg-white);
}

.portfolio-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.portfolio-img {
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.portfolio-body {
    padding: 24px;
}

.portfolio-body h5 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.portfolio-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.portfolio-tag {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

/* ---------- Contact Section ---------- */
#contact {
    background: var(--bg-light);
}

.contact-info-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: 16px;
    padding: 40px 30px;
    color: var(--text-light);
    height: 100%;
}

.contact-info-card h4 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-item i {
    font-size: 1.2rem;
    margin-right: 15px;
    margin-top: 4px;
    color: var(--accent);
    width: 20px;
    text-align: center;
}

.contact-item p {
    margin-bottom: 0;
    line-height: 1.6;
}

.contact-item a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--accent);
}

.btn-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #06c755;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    margin-top: 1rem;
}

.btn-line:hover {
    background: #05a847;
    color: white;
    transform: translateY(-2px);
}

.contact-form-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: var(--shadow);
    height: 100%;
}

.contact-form-card h4 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-light);
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(21, 101, 192, 0.3);
    color: var(--text-light);
}

/* ---------- Court Judgment Search ---------- */
#court {
    background: var(--bg-white);
}

.court-search-box {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.court-search-box .form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.court-search-box .form-control,
.court-search-box .form-select {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.court-search-box .form-control:focus,
.court-search-box .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.3);
}

.btn-court-search {
    background: var(--accent);
    color: var(--primary-dark);
    border: none;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 700;
    transition: var(--transition);
}

.btn-court-search:hover {
    background: #ffca28;
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 213, 79, 0.4);
}

.btn-court-clear {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-court-clear:hover {
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.court-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 12px 20px;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.court-stats strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.court-result-card {
    background: var(--bg-white);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.court-result-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.court-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.court-case-no {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
}

.court-case-no:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.court-type-tag {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.court-type-tag.civil {
    background: #e3f2fd;
    color: #1565c0;
}

.court-type-tag.criminal {
    background: #fce4ec;
    color: #c62828;
}

.court-type-tag.admin {
    background: #e8f5e9;
    color: #2e7d32;
}

.court-result-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.court-result-meta i {
    margin-right: 4px;
    color: var(--primary-light);
}

.court-result-summary {
    color: #555;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.court-view-btn {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.court-view-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.court-no-result {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.court-no-result i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

.court-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.court-pagination .page-btn {
    min-width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.court-pagination .page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.court-pagination .page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-light);
}

.court-pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Court Modal */
.court-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text-light);
    border-radius: 12px 12px 0 0;
}

.court-modal .modal-header .btn-close {
    filter: invert(1);
}

.court-modal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.court-modal .modal-body {
    padding: 30px;
}

.court-detail-label {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.court-detail-value {
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    line-height: 1.8;
}

.court-detail-value:last-child {
    border-bottom: none;
}

.court-fulltext {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    font-size: 0.95rem;
    line-height: 2;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* ---------- Footer ---------- */
footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0 20px;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--accent);
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.15);
    margin: 20px 0;
}

/* ---------- Scroll-to-top ---------- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.4);
    z-index: 999;
    cursor: pointer;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ---------- Animations ---------- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    section {
        padding: 60px 0;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(even) {
        width: 100%;
        margin-left: 0;
        padding-left: 50px;
        padding-right: 0;
        text-align: left;
    }

    .timeline-item:nth-child(odd) {
        padding-right: 0;
        padding-left: 50px;
        text-align: left;
    }

    .timeline-dot,
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 12px;
        right: auto;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .advantage-card {
        margin-bottom: 1rem;
    }
}
