/********** Template CSS **********/
:root {
    --primary: #28a745;
    --secondary: #2B9BFF;
    --light: #EFFDF5;
    --dark: #2B3940;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/*** Button ***/
.btn {
    font-weight: 500;
    transition: .5s;
}

.btn.btn-primary,
.btn.btn-secondary {
    color: #FFFFFF;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

/*** Navbar ***/
.navbar-light .navbar-nav .nav-link {
    padding: 30px 15px;
    color: var(--dark);
    outline: none;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .navbar-light .navbar-nav .nav-link  {
        padding: 10px 0;
    }
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.35); /* 白色 + 透明度 */
  backdrop-filter: blur(8px); /* 可選：模糊背景 */
  -webkit-backdrop-filter: blur(8px); /* Safari 支援 */
  box-shadow: 0 2px 8px rgba(203, 91, 91, 0.1); /* 陰影 */
}

/* 避免内容被 header 遮住 */
body {
  padding-top: 160px; /* 根据 header 高度来设 */
}

/* 确保小屏幕 header 仍固定 */
@media (max-width: 991px) {
  .header {
    position: fixed;
    top: 0;
  }
}



/*** Header ***/
.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(43, 57, 64, .5);
    z-index: 1;
}

.carousel-control-prev,
.carousel-control-next {
    width: 10%;
    z-index: 1050;
    pointer-events: auto;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9; /* 或手動固定 height */
}


.page-header {
    background: linear-gradient(rgba(43, 57, 64, .5), rgba(43, 57, 64, .5)), url('assets/img/login2.jpg') center center no-repeat;
    background-size: cover;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--light);
}

/*** About ***/
.about-bg {
    background: linear-gradient(rgba(43, 57, 64, .5), rgba(43, 57, 64, .5)), url("assets/img/login2.jpg") center center no-repeat;
    background-size: cover;
}

.about-img {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.about-img:hover img {
    transform: scale(1.05);
}

/*** Service ***/
.service-item {
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transition: .5s;
}

.service-item:hover {
    background: var(--primary);
}

.service-item * {
    transition: .5s;
}

.service-item:hover * {
    color: var(--light) !important;
}

/*** Categories & Courses ***/
.category img,
.course-item img {
    transition: .5s;
}

.category a:hover img,
.course-item:hover img {
    transform: scale(1.1);
}

/*** Team ***/
.team-item img {
    transition: .5s;
}

.team-item:hover img {
    transform: scale(1.1);
}

.team-item .team-social {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .5s;
}

.team-item:hover .team-social {
    background: rgba(0, 0, 0, .3);
}

.team-item .team-social .btn {
    margin: 0 3px;
    opacity: 0;
}

.team-item:hover .team-social .btn {
    opacity: 1;
}

/*** Blog ***/
.blog-item {
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transition: .5s;
}

.blog-item:hover {
    transform: translateY(-3px);
}

.blog-item .blog-date {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary);
    color: #FFFFFF;
    padding: 15px;
    text-align: center;
}

.blog-item .blog-date h6 {
    font-size: 1.2rem;
    margin: 0;
}

.blog-item .blog-date small {
    font-size: 0.8rem;
}

/*** Contact ***/
.contact-info .d-flex {
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.contact-info .d-flex:last-child {
    border-bottom: none;
}

.contact-info .d-flex i {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 50%;
    margin-right: 20px;
}

.contact-info .d-flex h5 {
    color: var(--primary);
    margin-bottom: 5px;
}

.contact-info .d-flex p {
    margin: 0;
}

.contact-form {
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
}

.contact-form .form-control {
    border: none;
    border-bottom: 2px solid rgba(0, 0, 0, .1);
    border-radius: 0;
    padding: 15px 0;
    background: transparent;
}

.contact-form .form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.map-container {
    position: relative;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 450px;
    border: 0;
}

/*** Footer ***/
.footer .btn.btn-social {
    margin-right: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 35px;
    transition: .3s;
}

.footer .btn.btn-social:hover {
    color: var(--primary);
    border-color: var(--light);
}

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
    text-decoration: none;
    transition: .3s;
}

.footer .btn.btn-link:hover {
    color: var(--light);
    text-decoration: none;
}

.footer .form-control {
    border-color: rgba(255, 255, 255, 0.2);
}

.footer .copyright {
    border-color: rgba(256, 256, 256, .1) !important;
}

.footer .copyright a {
    color: var(--light);
}

.footer .copyright a:hover {
    color: var(--primary);
}

/*** Responsive ***/
@media (max-width: 768px) {
    .carousel-caption h1 {
        font-size: 2rem;
    }
    
    .carousel-caption h4 {
        font-size: 1rem;
    }
    
    .about-text {
        margin: 0 !important;
    }
    
    .service-item {
        margin-bottom: 30px;
    }
}

@media (max-width: 576px) {
    .carousel-caption h1 {
        font-size: 1.5rem;
    }
    
    .carousel-caption .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/*** Custom Animations ***/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/*** Loading Spinner ***/
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/*** Alert Styles ***/
.alert {
    border: none;
    border-radius: 0;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/*** Form Validation ***/
.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/*** Feature Boxes ***/
.feature-box {
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transition: .5s;
}

.feature-box:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.feature-text h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

/*** Social Links ***/
.social-links .btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: .3s;
}

.social-links .btn:hover {
    transform: translateY(-2px);
}

/*** Contact Links ***/
.contact-link {
    color: var(--dark);
    transition: .3s;
}

.contact-link:hover {
    color: var(--primary);
    text-decoration: none;
}


/* === 強化全局響應式設計 === */
img, video, canvas, svg, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

.container, .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body, html {
    overflow-x: hidden;
}

table {
    width: 100% !important;
    display: block;
    overflow-x: auto;
    word-break: break-all;
}

/* 字體大小自適應 */
html {
    font-size: 16px;
}
@media (max-width: 1200px) {
    html { font-size: 15px; }
}
@media (max-width: 992px) {
    html { font-size: 14px; }
}
@media (max-width: 768px) {
    html { font-size: 13px; }
}
@media (max-width: 576px) {
    html { font-size: 12px; }
}

/* 補充按鈕、間距、標題等在小屏幕下的自適應 */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
    .btn, .btn-primary, .btn-secondary {
        padding: 10px 18px;
        font-size: 1rem;
    }
    .container, .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }
}
@media (max-width: 576px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.1rem; }
    h3 { font-size: 1rem; }
    .btn, .btn-primary, .btn-secondary {
        padding: 8px 12px;
        font-size: 0.95rem;
    }
}


