:root {
    --primary: #5CC4B8;
    --dark: #4F6466;
    --light: #ffffff;
    --green: #4F6466;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; margin: 0; padding: 0; height: auto; overflow-x: hidden; }
body { font-family: 'Noto Sans TC', Arial, sans-serif; line-height: 1.6; color: var(--dark); background: #fff; padding-top: 84px; min-width: 310px; height: auto; overflow-x: hidden; }
a { text-decoration: none; transition: all 0.2s ease 0s; color: var(--primary); }
a:hover { color: #101010; opacity: 0.75; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Header */
header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    z-index: 100;
    width: 100%;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary); }
.logo img { height: 52px; vertical-align: middle; }

.search-bar {
    width: 100%;
    padding: 0.25rem 0.75rem;
    border: 1px solid #ccc;
    background-color: var(--light);
    border-radius: 4px;
    height: 45px;
    outline: none;
    font-size: 14px;
    line-height: 14px;
    color: var(--dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.search-bar::placeholder {
    font-size: 15px;
    color: var(--dark);
}
.btn {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    outline: none;
}
.btn:hover {
    background: var(--primary);
    outline: none;
}

/* Nav */
nav ul {
    display: flex;
    list-style: none;
    gap: 4rem;
    margin: 0;
}
nav a {
    color: var(--dark);
    font-weight: 500;
    position: relative;
}
nav a:hover, nav a.active {
    color: var(--primary);
    opacity: 1;
}

nav a:hover::before, nav a.active::before {
    content: '';
    width: 42px;
    height: 4px;
    background-color: var(--primary);
    position: absolute;
    left: 50%;
    margin-left: -21px;
    bottom: -7px;
    border-radius: 2px;

}

/* Hero Banner */
.hero {
    background-image: url('../images/hero_banner.jpg');
    width: 100%;
    background-size: 100% auto;
    background-repeat: repeat;
    background-position: 0 0;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    height: 480px;
    overflow: hidden;
    animation: slide 300s linear infinite;
    position: relative;
    z-index: 50;
}
@keyframes slide {
    0% { background-position: 0 0; }
    50% { background-position: -1024px -1024px; }
    100% { background-position: 0 0; }
}
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.1rem; margin-bottom: 1.5rem; }

.hero .container {
    position: relative;
}

/* Doctor List Table */
.doctor-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 0 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
}
.doctor-table thead {
    background: var(--primary);
    color: white;
}
.doctor-table th, .doctor-table td {
    padding: 0.5rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.doctor-table th, .doctor-table td:nth-child(1) {
    min-width: 200px;
}
.doctor-table th, .doctor-table td:nth-child(2) {
    min-width: 150px;
}
.doctor-table th, .doctor-table td:nth-child(4) {
    min-width: 250px;
}
.doctor-table td.doctor-m {
    background-image: url("../images/icon_doc_m.png");
    padding-left: 52px;
    background-size: 20px auto;
    background-repeat: no-repeat;
    background-position: left 1.5rem center;
}
.doctor-table td.doctor-f {
    background-image: url("../images/icon_doc_f.png");
    padding-left: 52px;
    background-size: 20px auto;
    background-repeat: no-repeat;
    background-position: left 1.5rem center;
}
.doctor-table th { font-weight: 600; }
.doctor-table tbody tr:hover {
    background: #F5FDFC !important;
}
.doctor-table tbody tr:nth-child(odd) {
    background-color: #EAF7F5;
}
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.3rem;
}
.action-btn:hover { color: var(--primary); }

/* Footer */
footer {
    background: var(--green);
    color: #ccc;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 13px;
}

footer p {
    margin: 0;
}

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

.col-subject {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-inner { flex-direction: column; text-align: center; }
    nav ul { justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
    .search-bar input { flex: 1; }
    .doctor-table { font-size: 0.9rem; }
    .doctor-table th, .doctor-table td { padding: 0 0.5rem; }
    .doctor-table th {
        display: none;
    }
    .doctor-table td {
        display: block;
        border-bottom: none;
        border-left: solid 1px #ADDED8;
        border-right: solid 1px #ADDED8;
    }
    .doctor-table tr:first-child td:first-child {
        border-top: solid 1px #ADDED8;
        border-radius: 5px 5px 0 0;
    }
    .doctor-table tr:last-child td:last-child {
        border-bottom: solid 1px #ADDED8;
        border-radius: 0 0 5px 5px;
    }
    .doctor-table td:first-child {
        padding-top: 10px;
    }
    .doctor-table td:last-child {
        padding-bottom: 10px;
    }
    .doctor-table td.doctor-m, .doctor-table td.doctor-f {
        background-position: top 13px left 10px;
        padding-left: 35px;
        font-weight: bold;
        color: #606060;
        font-size: 16px;
    }
    .col-subject {
        display: inline-block;
        color: var(--primary);
        font-weight: bold;
    }
}

.banner-left-object-group {
    background: url("../images/page_banner_object_01.png") center/cover no-repeat;
    width: 731px;
    height: 480px;
    position: relative;
    z-index: 50;
}

.banner-left-object-group .green-line {
    width: 60%;
    height: 40px;
    background-color: #5CC4B8;
    position: absolute;
    margin-left: 20%;
    bottom: 95px;
    left: 0;
    z-index: 25;
}

.banner-left-object-group .absolute-group {
    width: 100%;
    position: absolute;
    bottom: 25px;
    z-index: 50;
}

.banner-right-object-group {
    width: 400px;
    height: 100%;
    position: absolute;
    z-index: 70;
    bottom: 0;
    right: 0;
}

@media (max-width: 1200px) {

    .hero {
        height: 390px;
    }

    .banner-left-object-group {
        transform: scale(0.8);
        transform-origin: top left;
    }

    .banner-right-object-group {
        transform: scale(0.8);
        transform-origin: top right;
        right: 0;
    }

}

@media (max-width: 768px) {

    .hero {
        height: 240px;
    }

    .banner-left-object-group {
        transform: scale(0.5);
        transform-origin: top left;
    }

    .banner-right-object-group {
        transform: scale(0.5);
        transform-origin: top right;
        right: 0;
    }

}

@media (max-width: 540px) {

    .hero {
        height: 170px;
    }

    .banner-left-object-group {
        transform: scale(0.35);
        transform-origin: top left;
    }

    .banner-right-object-group {
        transform: scale(0.35);
        transform-origin: top right;
    }

}

.banner-right-object-group img {
    max-width: none;
}

.banner-right-object-group .position-a {
    right: 0;
    bottom: 0;
    position: absolute;
    z-index: 10;
}

.banner-right-object-group .position-b {
    right: 290px;
    top: 100px;
    position: absolute;
    z-index: 20;
    animation: float-position-b 2s ease-in-out infinite;
}

@keyframes float-position-b {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.banner-right-object-group .position-c {
    right: 350px;
    top: 170px;
    position: absolute;
    z-index: 20;
    animation: float-position-c 2s ease-in-out infinite;
}

@keyframes float-position-c {
    0%, 100% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(0);
    }
}

.banner-right-object-group .position-d {
    right: 390px;
    top: 110px;
    position: absolute;
    z-index: 20;
    animation: float-position-d 2s ease-in-out infinite;
}

@keyframes float-position-d {
    0%, 100% {
        transform: translateX(-10px);
    }
    50% {
        transform: translateX(0);
    }
}

.banner-right-object-group .position-e {
    right: -50px;
    top: 210px;
    position: absolute;
    z-index: 20;
    animation: float-position-e 2s ease-in-out infinite;
}

@keyframes float-position-e {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

.banner-right-object-group .position-f {
    right: 50px;
    top: 15px;
    position: absolute;
    z-index: 20;
    animation: float-position-f 2s ease-in-out infinite;
}

@keyframes float-position-f {
    0%, 100% {
        transform: translateX(-10px);
    }
    50% {
        transform: translateX(0);
    }
}

.banner-right-object-group .position-g {
    right: 0;
    top: 120px;
    position: absolute;
    z-index: 20;
    animation: float-position-g 2s ease-in-out infinite;
}

@keyframes float-position-g {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-10px);
    }
}

/******/

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s forwards;
    display: inline-block;
}

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

.div1 {
    animation-delay: 0.3s;
}
.div2 {
    animation-delay: 0.6s;
}
.div3 {
    animation-delay: 0.9s;
}

.green-line-fade-in {
    opacity: 0;
    animation: green-line-fadeIn 1s forwards;
    display: inline-block;
}

@keyframes green-line-fadeIn {
    to {
        opacity: 1;
    }
}

.div4 {
    animation-delay: 1.2s;
}

h2 {
    font-size: 29px;
    margin: 0;
    color: var(--dark);
    font-weight: normal;
}

h3 {
    font-size: 21px;
    color: var(--primary);
    border-left: solid 4px var(--primary);
    padding-left: 15px;
}

a.btn-details {
    background-color: var(--light);
    color: var(--primary);
    border: solid 1px var(--primary);
    opacity: 1;
    padding: 3px 12px;
    font-size: 14px;
    border-radius: 4px;
    margin: 3px;
    display: inline-block;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

a.btn-appointment {
    border: solid 1px var(--primary);
    opacity: 1;
    padding: 3px 12px;
    font-size: 14px;
    border-radius: 4px;
    margin: 3px;
    display: inline-block;
    background-image: linear-gradient(180deg, #5CC4B8, #3A8F7B);
    background-color: var(--primary);
    color: var(--light);
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

a.btn-appointment.big-btn {
    padding: 8px 30px;
    width: auto;
}

@media (max-width: 768px) {
    a.btn-appointment.big-btn {
        padding: 9px 12px;
        width: 100%;
    }
}

.top-spacing {
    margin-top: -70px;
    position: relative;
}

.top-spacing.homepage {
    margin-top: -65px;
}

@media (max-width: 768px) {

    .top-spacing {
        margin-top: -68px;
    }

    .top-spacing.homepage {
        margin-top: -45px;
    }

}

.middle-search-bar {
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    z-index: 70;
    width: 800px;
    max-width: 100%;
    margin: 0 auto 50px auto;
    font-size: 15px;
    position: relative;
}

.middle-search-bar select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    color: var(--dark);
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.middle-search-bar button {
    padding: 10px 20px;
    background-image: linear-gradient(180deg, #5CC4B8, #3A8F7B);
    background-color: var(--primary);
    color: var(--light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 15px;
}
.middle-search-bar button:hover {
    background-color: var(--primary);
    opacity: 1;
}

@media (max-width: 768px) {
    .middle-search-bar {
        grid-template-columns: repeat(3, 1fr);
    }
    .full-width {
        grid-column: 1 / -1;
    }
    .middle-search-bar select {
        height: 34px;
        padding: 5px 10px !important;
        box-shadow: none;
        width: 100%;
    }
    .search-bar {
        height: 34px;
        box-shadow: none;
        width: 100%;
    }
    .middle-search-bar button {
        height: 42px;
        line-height: 34px;
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    .position-b, .position-c, .position-d {
        display: none;
    }
}

.subpage-banner {
    background: url('../images/page_banner_bg.jpg') center/cover no-repeat;
    color: white;
    text-align: left;
    margin-bottom: 2rem;
    overflow: hidden;
    padding: 35px 0 55px 0;
    background-image: url('../images/hero_banner.jpg');
    width: 100%;
    background-size: 100% auto;
    background-repeat: repeat;
    background-position: 0 0;
    animation: subpage-slide 300s linear infinite;
}
@keyframes subpage-slide {
    0% { background-position: 0 0; }
    50% { background-position: -1024px -1024px; }
    100% { background-position: 0 0; }
}

.subpage-banner.balance-padding {
    padding: 35px 0 35px 0;
}

.pagination {
    display: inline-block;
    margin-top: 35px;
}
.pagination a {
    color: var(--dark);
    font-size: 14px;
    padding: 8px 10px;
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0 4px;
    border-radius: 4px;
    transition: background-color 0.3s;
}
.pagination a:hover {
    background-color: #ddd;
}
.pagination a.active {
    background-color: var(--primary);
}
.pagination .active {
    background-color: #4CAF50;
    color: white;
    border: 1px solid #4CAF50;
}

.pagination select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    color: var(--dark);
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

a.view-doctor-list {
    text-decoration: underline;
}

/* for fun */
@keyframes rotate {
	100% {
		transform: rotate(1turn);
	}
}

.rainbow {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
    z-index: 70;
    background-color: #fff;

	&::before {
		content: '';
		position: absolute;
		z-index: -2;
		left: -50%;
		top: -50%;
		width: 200%;
		height: 200%;
		background-color: #399953;
		background-repeat: no-repeat;
		background-size: 100%;
		background-position: 0 0%, 100% 0, 100% 100%, 0 100%;
		background-image: linear-gradient(#fff, #5CC4B8, #5CC4B8, #5CC4B8, #5CC4B8, #fff);
		animation: rotate 12s ease-in-out infinite;
        opacity: 0.25;
	}

	&::after {
		content: '';
		position: absolute;
		z-index: -1;
		left: 4px;
		top: 4px;
		width: calc(100% - 8px);
		height: calc(100% - 8px);
		background: white;
		border-radius: 5px;
		animation: opacityChange 6s ease-in-out infinite;
	}
}

@keyframes opacityChange {
	50% {
		opacity:1;
	}
	100% {
		opacity:1;
	}
}

 #textLoop {
    opacity: 1;
    transition: opacity 1s;
}

.total-page-items {
    float: right;
    font-size: 14px;
    color: var(--dark);
}

.small-title {
    position: relative;
    z-index: 72;
    top: -12px;
    left: -3px;
    margin-bottom: -20px;
    opacity: 0.9;
    transition: opacity 1s;
}

.small-title .container {
    width: 800px;
    max-width: 100%;
}

.small-title .container span {
    display: inline-block;
    width: auto;
    background-image: linear-gradient(180deg, #777, #999);
    color: var(--light);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    position: relative;
}

.small-title .container span::after {
    content: '';
    position: absolute;
    bottom: -6.5px;
    left: 10%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #999;
}

.doctor-profile {
    margin-top: -90px;
}

.card-box {
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 20px;
    margin-top: 25px;
}

.card-box p {
    margin: 0;
}

.article-box {
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 20px;
    margin-top: 25px;
}

.article-box p {
    margin-top: 25px;
}

.article-box img {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.article-box h5 {
    color: var(--primary);
}

.address-box {
    border-top: solid 1px var(--primary);
    padding-top: 15px;
    margin-top: 15px;
}

.address-box p {
    margin: 0;
}

.page-url {
    color: var(--dark);
}

.clinic-no {
    background-color: var(--dark);
    background-image: linear-gradient(180deg, var(--dark), #3A8F7B);
    color: var(--light);
    font-size: 13px;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    display: inline-block;
    border-radius: 5px;
    position: relative;
    top: -2px;
    margin-left: 4px;
}

.green-text {
    color: var(--primary);
    font-weight: bold;
}

.card-box .d-doctor-m {
    background-image: url("../images/icon_doc_m.png");
    padding-left: 35px;
    background-size: 28px auto;
    background-repeat: no-repeat;
    background-position: left center;
}
.card-box .d-doctor-f {
    background-image: url("../images/icon_doc_f.png");
    padding-left: 35px;
    background-size: 28px auto;
    background-repeat: no-repeat;
    background-position: left center;
}

.card-box h2 {
    color: var(--primary);
}

.letter-spacing {
    display: inline-block;
    transform: scaleX(0.5);
}

.appointment-form {
    padding: 20px 0;
}

.appointment-form h2 {
    margin-bottom: 15px;
}

.appointment-form hr {
    background-color: none;
    margin: 30px 0 15px 0;
    opacity: 0.75;
    border-bottom: dashed 1px var(--dark);
    width: 100%;
    height: 0;
}

.appointment-form b {
    margin-top: 10px;
    display: inline-block;
    position: relative;
}

.appointment-form b::before {
    position: absolute;
    content: '*';
    right: -7px;
    top: 0;
    color: var(--primary);
    font-weight: bold;
}

.appointment-form label {
    margin: 0;
    display: block;
}

.appointment-form .form-check {
    display: inline-block;
}

.appointment-form .form-check-input {
    margin-top: 7px;
}

.appointment-form .form-check-label {
    margin-right: 10px;
}

.appointment-form select {
    border: 1px solid #ccc;
    height: 42px;
    line-height: 42px;
    border-radius: 4px;
    outline: none;
    color: var(--dark);
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #ccc;
}

.appointment-form input[type="text"], .appointment-form input[type="tel"], .appointment-form input[type="email"] {
    border: 1px solid #ccc;
    height: 42px;
    line-height: 42px;
    border-radius: 4px;
    outline: none;
    color: var(--dark);
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.appointment-form textarea {
    border: 1px solid #ccc;
    height: 150px;
    border-radius: 4px;
    resize: none;
    outline: none;
    color: var(--dark);
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.appointment-form button {
    width: 100%;
    padding: 10px 20px;
    background-image: linear-gradient(180deg, #5CC4B8, #3A8F7B);
    background-color: var(--primary);
    color: var(--light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.appointment-form button:hover {
    background-color: var(--primary);
    opacity: 1;
}

.code-display {
    font-weight: bold;
    display: inline-block;
    font-size: 17px;
    padding: 5px 20px;
    border-radius: 2px;
    margin: 5px 0;
    background: var(--dark);
    color: var(--primary);
}

/* select2 css */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 8px !important;
    position: absolute;
    width: 8px !important;
    top: 50% !important;
    right: 12px !important;
    margin-top: -6px !important;
    border: solid #5CC4B8;
    border-width: 0 3px 3px 0;
    display: inline-block;
    transform: rotate(45deg);
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 43px !important;
    color: var(--dark) !important;
    font-size: 15px !important;
}

.select2-container .select2-selection--single {
    height: 45px !important;
}

.select2-container--default .select2-selection--single {
    padding: 0 5px;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    outline: none;
    color: var(--dark);
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    font-size: 13px !important;
}

.select2-results__option {
    font-size: 13px !important;
}

@media (max-width: 768px) {
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 32px !important;
    }
    .select2-container .select2-selection--single {
        height: 34px !important;
        box-shadow: none !important;
    }

}

.rating {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    margin: 5px 0;
}
.stars {
    margin-left: 10px;
}
.stars img {
    width: 15px;
    height: auto;
    margin-right: 4px;
    margin-top: -5px;
}
