:root {
    --left-bar-width: 30px;
}

@media (min-width: 768px) {
    :root {
        --left-bar-width: 50px;
    }
}

html {
    overflow-x: hidden;
    background-color: #003a5f;
}

body {
    background: #003a5f;
    font-family: 'Noto Sans JP', sans-serif;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    /* overscroll-behavior-y: contain; */
}

body.page-body {
    font-family: 'Noto Sans JP', sans-serif;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    /* overscroll-behavior-y: contain; */
}

body.page-body.overflow-hidden {
    overflow: hidden;
}

body.page-body.bg-gray-50 {
    background: #f9fafb;
}

/* スクロールバーの表示を許可（以前は非表示設定）
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
*/

/*
html,
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
*/

#loader-container {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #003a5f;
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

#loader-container.hidden {
    pointer-events: none;
}

#loader {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: transparent;
    /* Initial text hidden to prevent flash */
    display: inline-block;
}

#loader span {
    display: inline-block;
    opacity: 0;
    transform: scaleY(0.1) scaleX(0.8);
    color: #fff;
    /* Ensure animated text is visible */
}

/* Hero Slider Styles */
.slide {
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(1);
    transform-origin: center center;
    -webkit-transform: scale(1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.slide.show {
    opacity: 1;
}

.slide.zooming {
    animation: zoomIn 6.5s linear forwards;
}

@keyframes zoomIn {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.15);
    }
}

/* Scrolling Line Animation */
@keyframes scrollLine {
    0% {
        height: 0;
        top: 0;
    }

    50% {
        height: 100%;
        top: 0;
    }

    100% {
        height: 0;
        top: 100%;
    }
}

.scroll-line {
    position: absolute;
    width: 1px;
    height: 0;
    background-color: white;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollLine 2s ease-in-out infinite;
}

.scroll-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid white;
}

/* Hero Content Wrapper - Always exclude right bar */
.hero-content-wrapper {
    right: var(--left-bar-width) !important;
}

/* Hero Content Container - Responsive Layout */
.hero-content-container {
    left: 0;
    right: var(--left-bar-width);
    top: 8vh;
    bottom: 35vh;
}

/* Mobile: もっと上に配置 */
@media (max-width: 767px) {
    .hero-content-container {
        top: 5vh;
        bottom: 38vh;
    }
}

/* iPad縦表示: メッセージボックスとの距離を調整 */
@media (min-width: 768px) and (max-width: 1023px) and (min-height: 900px) {
    .hero-content-container {
        top: 8vh;
        bottom: 25vh;
    }
}

/* Desktop: メッセージボックスとの距離を調整 */
@media (min-width: 1024px) and (min-height: 800px) {
    .hero-content-container {
        top: 8vh;
        bottom: 22vh;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 800px) and (min-width: 768px) {
    .hero-content-container {
        top: 10vh;
        bottom: 24vh;
    }

    .hero-title {
        font-size: 2.25rem !important;
        margin-bottom: 0.875rem !important;
        line-height: 1.6 !important;
    }

    .hero-logo img {
        height: 8rem !important;
    }

    .hero-buttons {
        margin-bottom: 1.75rem !important;
    }

    .hero-buttons img {
        height: 3.5rem !important;
    }
}

/* Very short screens (extreme landscape) */
@media (max-height: 600px) {
    .hero-content-container {
        top: 5vh;
        bottom: 35vh;
    }

    .hero-title {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    .hero-logo img {
        height: 3.5rem !important;
    }

    .hero-buttons {
        margin-bottom: 0.5rem !important;
    }

    .hero-buttons img {
        height: 2.5rem !important;
    }
}

/* Message Box Carousel */
.message-carousel {
    display: flex;
    transition: transform 0.8s ease-out;
    align-items: center;
}

.message-box {
    flex-shrink: 0;
    width: 80%;
    margin: 0 2.5%;
    opacity: 0.5;
    transform: scale(0.85);
    transition: all 0.8s ease-out;
}

@media (min-width: 768px) {
    .message-box {
        width: 50%;
    }
}

.message-box.active {
    opacity: 1;
    transform: scale(1);
}

/* Carousel Navigation Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.carousel-arrow:hover::before {
    border-color: #333;
    transform: scale(1.2);
}

.carousel-arrow.prev {
    left: 5%;
}

.carousel-arrow.next {
    right: 5%;
}

@media (min-width: 768px) {
    .carousel-arrow.prev {
        left: 20%;
    }

    .carousel-arrow.next {
        right: 20%;
    }
}

.carousel-arrow::before {
    content: '';
    width: 16px;
    height: 16px;
    border-top: 3px solid #555;
    border-right: 3px solid #555;
    transition: all 0.3s ease;
}

.carousel-arrow.prev::before {
    transform: rotate(-135deg);
}

.carousel-arrow.next::before {
    transform: rotate(45deg);
}

.carousel-arrow.prev:hover::before {
    transform: rotate(-135deg) scale(1.2);
}

.carousel-arrow.next:hover::before {
    transform: rotate(45deg) scale(1.2);
}

/* Scroll Fade In Animation */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

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

/* Pop In Animation */
.pop-in {
    opacity: 0;
    transform: scale(0);
}

.pop-in.visible {
    animation: popIn 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    45% {
        opacity: 1;
        transform: scale(1.15);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pop In with Top Line Animation */
.pop-in-with-topline {
    position: relative;
    padding-top: 20px;
}

.pop-in-with-topline::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    background-color: #0066cc;
    width: 0;
    height: 0;
    transition: width 0.6s cubic-bezier(0.785, 0.135, 0.15, 0.86), height 0.1s;
}

.pop-in-with-topline.visible::before {
    width: 120px;
    height: 3px;
    transition-delay: 0.6s;
}

/* Chat Message Animation */
.chat-message {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.chat-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hide scrollbar in chat area */
#chat-area {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    scroll-behavior: smooth;
    /* Smooth scrolling */
}

#chat-area::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Animated Title Effect */
.animated-title {
    position: relative;
    display: inline-block;
    --underline-color: rgb(139, 92, 246);
    --underline-width: 200px;
    --animation-duration: 0.5s;
    --animation-delay-step: 0.1s;
    --animation-initial-delay: 0.1s;
}

.animated-title span {
    display: inline-block;
    opacity: 0;
    filter: blur(3px);
    transform: scale(3);
}

.animated-title span.in-view {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
    transition: var(--animation-duration) cubic-bezier(0.25, 0.1, 0.25, 1) var(--animation-initial-delay);
}

.animated-title span.in-view:nth-of-type(1) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 0);
}

.animated-title span.in-view:nth-of-type(2) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 1);
}

.animated-title span.in-view:nth-of-type(3) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 2);
}

.animated-title span.in-view:nth-of-type(4) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 3);
}

.animated-title span.in-view:nth-of-type(5) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 4);
}

.animated-title span.in-view:nth-of-type(6) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 5);
}

.animated-title span.in-view:nth-of-type(7) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 6);
}

.animated-title span.in-view:nth-of-type(8) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 7);
}

.animated-title span.in-view:nth-of-type(9) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 8);
}

.animated-title span.in-view:nth-of-type(10) {
    transition-delay: calc(var(--animation-initial-delay) + var(--animation-delay-step) * 9);
}

.animated-title::after {
    content: " ";
    position: absolute;
    bottom: -8px;
    left: 0;
    display: block;
    background-color: var(--underline-color);
    width: 0;
    height: 0;
    transition: 0.4s cubic-bezier(0.785, 0.135, 0.15, 0.86) 0.5s;
}

.animated-title.in-view::after {
    width: var(--underline-width);
    height: 3px;
}

/* Center aligned underline */
.animated-title-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Recommend Cards Slide Animation */
.recommend-card {
    transition: all 0.8s ease-out;
}

.recommend-left {
    transform: translateX(-100px);
}

.recommend-right {
    transform: translateX(100px);
}

.recommend-card.visible {
    opacity: 1 !important;
    transform: translateX(0);
}

/* Image Carousel Styles from home.blade.php */
.cb_design_carousel {
    padding: 40px 0 80px;
    background: #fff;
}

.cb_design_carousel .desc .mobile {
    display: none;
}

.cb_image_slider_wrap {
    overflow: hidden;
    height: 580px;
    position: relative;
}

.cb_image_slider_wrap::-webkit-scrollbar {
    display: none;
}

.cb_image_slider {
    white-space: nowrap;
    font-size: 0;
    transform: translate3d(0, 0, 0);
    animation-name: carousel_slide;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-fill-mode: forwards;
}

@keyframes carousel_slide {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

.cb_image_slider .item {
    display: inline-block;
    width: 310px;
    height: 580px;
    position: relative;
    overflow: hidden;
    margin: 0 50px 0 0;
    vertical-align: top;
    font-size: 16px;
    white-space: normal;
}

.cb_image_slider .image {
    width: 100%;
    height: 440px;
    border-radius: 15px;
    overflow: hidden;
    display: block;
    position: relative;
}

.cb_image_slider .item:nth-child(even) .image {
    margin-top: 180px;
}

.cb_image_slider .image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.cb_image_slider .title {
    position: absolute;
    top: 470px;
    width: 100%;
    text-align: center;
    font-size: 18px;
    line-height: 1.8;
    max-height: 3.6em;
    overflow: hidden;
    visibility: visible;
    display: block;
}

.cb_image_slider .title span {
    display: -webkit-inline-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.cb_image_slider .item:nth-child(even) .title {
    top: 20px;
    bottom: auto;
}

@media screen and (max-width: 1180px) {
    .cb_design_carousel .desc .pc {
        display: none;
    }

    .cb_design_carousel .desc .mobile {
        display: block;
    }

    .cb_image_slider_wrap {
        height: 470px;
    }

    .cb_image_slider .item {
        width: 250px;
        height: 470px;
        margin: 0 30px 0 0;
        overflow: hidden;
    }

    .cb_image_slider .image {
        height: 300px;
    }

    .cb_image_slider .title {
        top: 310px;
        font-size: 16px;
    }

    .cb_image_slider .item:nth-child(even) .title {
        top: 15px;
        bottom: auto;
    }

    .cb_image_slider .item:nth-child(even) .image {
        margin-top: 130px;
    }

    .cb_image_slider .item:nth-child(even) .gallery-button {
        top: 60px;
    }

    .gallery-button {
        top: 380px;
    }

}

/* Gallery Button Position */
.gallery-button {
    position: absolute;
    top: 535px;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.cb_image_slider .item:nth-child(even) .gallery-button {
    top: 85px;
    bottom: auto;
}

/* Interview Button Hover Effect */
.interview-button:hover {
    background-color: #00608f !important;
}

/* Image Reveal Effect */
.image-reveal {
    position: relative;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.image-reveal.slide-in {
    opacity: 1;
    transform: translateY(0);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    z-index: 10;
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.revealed .image-overlay {
    transform: translateX(-100%);
}

/* Feature Overlay Slide-in Effects */
.feature-overlay-right {
    opacity: 0;
    transform: translateX(50%);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.feature-overlay-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.feature-overlay-left {
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.feature-overlay-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================
   Supporters Carousel Styles
   ========================================== */
.supporters-carousel-container {
    overflow: hidden;
}

.supporters-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.supporters-carousel-item {
    flex: 0 0 33.333%;
    padding: 0 10px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .supporters-carousel-item {
        flex: 0 0 60%;
        padding: 0 10px;
    }
}

/* Navigation Arrows */
.supporters-carousel-prev,
.supporters-carousel-next {
    cursor: pointer;
    border: none;
    outline: none;
}

.supporters-carousel-prev:hover,
.supporters-carousel-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Indicators */
.supporters-carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.supporters-carousel-indicator:hover {
    background-color: #9ca3af;
    transform: scale(1.2);
}

.supporters-carousel-indicator.active {
    background-color: #003a5f;
    width: 32px;
    border-radius: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .supporters-carousel-prev,
    .supporters-carousel-next {
        width: 36px;
        height: 36px;
        padding: 2px;
    }

    .supporters-carousel-prev {
        left: 8px;
    }

    .supporters-carousel-next {
        right: 8px;
    }
}

/* Solution Section Header Slide-in Animation */
.slide-in-bg {
    transform: translateX(-100%);
}

.slide-in-bg.animate {
    animation: slideInBg 0.7s ease-out forwards;
}

.slide-in-text {
    opacity: 0;
    transform: translateX(-100%);
}

.slide-in-text.animate {
    animation: slideInText 0.7s ease-out forwards;
}

.slide-in-text-delayed.animate {
    animation: slideInText 0.7s ease-out forwards;
}

@keyframes slideInBg {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInText {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Question Mark Wiggle Animation */
.wiggle-intermittent {
    animation: wiggleIntermittent 3s ease-in-out infinite;
}

@keyframes wiggleIntermittent {

    0%,
    12%,
    88%,
    100% {
        transform: rotate(12deg) scale(1);
    }

    2% {
        transform: rotate(9deg) scale(1.02);
    }

    4% {
        transform: rotate(15deg) scale(0.98);
    }

    6% {
        transform: rotate(8deg) scale(1.03);
    }

    8% {
        transform: rotate(16deg) scale(0.97);
    }

    10% {
        transform: rotate(12deg) scale(1.01);
    }
}