/* ==========================================================================
   Table of Contents:
   1. Font Imports
   2. Base Styles
   3. Header & Typography
   4. Layout Components
   5. Navigation & Menu
   6. Form Elements
   7. Buttons
   8. Products & Images
   9. Card Styles
   10. Video & Container Elements
   11. Utility Classes
   12. Animations
   13. Media Queries
   ========================================================================== */

/* 1. Font Imports */
@font-face {
    font-family: 'Roboto';
    src: url('assets/fonts/Roboto-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Kanit';
    src: url('assets/fonts/Kanit-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 2. Base Styles */
body {
    font-family: 'Roboto', sans-serif;
    position: relative;
    margin: 0;
    height: 100vh;
    background: linear-gradient(
        45deg,
        #a3b5c0,  /* Muted blue-gray */
        #c5d3dc,  /* Light grayish blue */
        #e6eef1,  /* Very light blue-gray */
        #b8c7d0,  /* Medium blue-gray */
        #9badb7   /* Darker blue-gray */
    );
    background-size: 400% 400%;
    animation: gradientMove 10s ease-in-out infinite;
}
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
        background-size: 400% 400%;
    }
    25% {
        background-position: 100% 50%;
        background-size: 200% 200%;
    }
    50% {
        background-position: 50% 100%;
        background-size: 300% 300%;
    }
    75% {
        background-position: 0% 50%;
        background-size: 200% 200%;
    }
    100% {
        background-position: 0% 50%;
        background-size: 400% 400%;
    }
}


/* 3. Header & Typography */
.header h1,
.header span {
    font-family: 'Kanit', sans-serif;
    background-image: linear-gradient(45deg,
        #5306f9 0%,
        #5f73d3 25%,
        #44b4ea 50%,
        #2ac0c2 75%,
        #5306f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.header h1 { font-size: 1.5rem !important; }
.header span { font-size: 1rem !important; }

/* 4. Layout Components */
.box {
    width: 95%;
    height: 90%;
    z-index: 1;
    background: rgba(255, 255, 255, 0.375);
    box-shadow: 0 0.75rem 2rem 0 rgba(0, 0, 0, 0.1);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.125);
    position: relative;
}

.section-height { height: 65vh !important; }
.contact-form-section { margin-top: -2rem; }

/* 5. Navigation & Menu */
.menu-list {
    margin: 0;
    padding: 0;
}

.menu li { list-style-type: none; }

.menu ul li a {
    color: #124857;
    text-decoration: none;
}

.menu ul li a.active {
    background-image: linear-gradient(45deg, #5306f9 25%, #f906ac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu ul li a:hover { color: #333333; }

/* 6. Form Elements */
.form-control:focus {
    border-color: rgb(216, 129, 216) !important;
    box-shadow: 0 1px 1px rgba(216, 129, 216, 0.075) inset !important;
}

.purple-bottom-border {
    border-bottom-color: rgba(128, 0, 128, 0.613) !important;
    color: rgba(128, 0, 128, 0.613) !important;
}

.purple-bottom-border::placeholder {
    color: rgb(93, 92, 92) !important;
}

/* 7. Buttons */
.btn-email {
    padding: 0.5em 1.8em;
    border: none;
    outline: none;
    color: #124857;
    background: #d8d8d898;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 10px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    font-size: 1rem;
}

.btn-email:before {
    content: "";
    background: linear-gradient(45deg,
        #b334ba,
        #ab30a9,
        #1046b7,
        #31aaea,
        #3bc5b0,
        #b334ba);
    position: absolute;
    top: -2px;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    -webkit-filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing-btn-email 30s linear infinite;
    transition: opacity 0.3s ease-in-out;
    border-radius: 10px;
}

.btn-email:after {
    z-index: -1;
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: #d3d3d3f4;
    left: 0;
    top: 0;
    border-radius: 10px;
}

/* 8. Products & Images */
.product-img {
    height: 100%;
    width: 100%;
}

.products-scroll {
    overflow-y: auto;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #9e80ff rgba(128, 128, 128, 0.1);
}

.products-scroll::-webkit-scrollbar {
    width: 4px;
    border-radius: 4px;
}

.products-scroll::-webkit-scrollbar-track {
    background: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
}

.products-scroll::-webkit-scrollbar-thumb {
    background-image: linear-gradient(45deg, #f906ac 25%, #5306f9 100%);
    border-radius: 10px;
}

.products-scroll::-webkit-scrollbar-thumb:hover {
    background-image: linear-gradient(45deg, #f906ac 25%, #5306f9 100%);
    border-radius: 10px;
    opacity: 0.8;
}

.gray-filter {
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.gray-filter:hover {
    filter: grayscale(0%);
    cursor: pointer;
}

.figure:hover .gray-filter {
    filter: grayscale(0%);
}

.figure:hover .product-description {
    display: flex !important;
    animation: slideUp 0.3s ease forwards;
}

.product-image {
    transition: filter 0.3s ease;
}

.product-image:hover {
    filter: grayscale(70%);
}

.product-caption {
    background-color: rgba(211, 211, 211, 0.7);
    bottom: 0.5rem;
}

/* 9. Card Styles */
.card-flip {
    perspective: 1000px;
    height: 300px;
    width: 100%;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.card-flip:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(23, 23, 23, 0.189);
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.2));
}

.card-front {
    display: flex;
    flex-direction: column;
}

.card-front .card-header {
    flex-shrink: 0;
}

.card-front img {
    flex: 1;
    width: 100%;
    height: calc(100% - 40px);
    object-fit: cover;
    padding: 0;
    margin: 0;
}

.card-back {
    transform: rotateY(180deg);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back .card-body {
    width: 100%;
    padding: 0.5rem;
}

.card-body-offset {
    margin-top: 0; /* Default for mobile */
}

/* For tablets and up */
@media (min-width: 768px) {
    .card-body-offset {
        margin-top: -5%;
    }
}

/* 10. Video & Container Elements */
/*.background-video {*/
/*    z-index: -1;*/
/*    object-fit: cover;*/
/*}*/

.main-container {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* 11. Utility Classes */
.main-color { color: #124857; }
.letter-spacing { letter-spacing: 0.01rem; }

.logo {
    object-fit: cover;
    position: relative;
    z-index: 1;
    display: block;
}

.contact-info a:hover {
    color: #5306f9 !important;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-decoration: underline !important;
}

/* 12. Animations */
@keyframes glowing-btn-email {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* 13. Media Queries */
/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .header h1 { font-size: 1.2rem !important; }
    .header span { font-size: .9rem !important; }
    .fs-md-7 { font-size: .8rem !important; }
    .message-textarea { rows: 4; }
}

/* Large Mobile (577px - 767px) */
@media (max-width: 767px) {
    .menu ul li a { font-size: 0.8rem !important; }
    .menu ul { margin-top: 6%; }
    .box {
        width: 95%;
        height: 95%;
        border-radius: 1.5rem;
        margin: 0 auto;
    }
    .product-box figure:hover .product-caption { display: none !important; }
    .product-box figure .product-caption { display: block; }
}

/* Small Mobile (< 576px) */
@media (max-width: 576px) {
    .header {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        padding: 5px;
    }
    
    .logo {
        width: 45px;
        height: auto;
        margin-right: 10px;
        flex: 0 0 auto;
        width: 20%;
    }
    
    .logo-section { width: 20%; }
    .menu-section { width: 80%; }
    
    .menu {
        flex: 1;
        min-width: 0;
        margin-left: 4%;
    }
    
    .menu ul {
        display: flex;
        align-items: center;
        margin: 0;
        padding: 0;
    }
    
    .menu ul li a { font-size: 0.6rem !important; }
    .fs-sm-7 { font-size: 0.6rem !important; }
    
    .btn-email {
        padding: 0.3em 2em;
        font-size: 0.8rem;
        border-radius: 5px;
    }
}

.about-us-link {
    white-space: nowrap;
}

.underline-decorator {
    bottom: -8px;
    width: 60px;
    height: 2px;
    background: var(--main-color);
}

.product-text {
    font-size: 12px !important;
}

.fs-9 {
    font-size: 0.75rem !important;
}

@media screen and (max-width: 576px) {
    .products-scroll .col-9 {
        width: 100% !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
    
    .card-back {
        padding: 2px !important;
    }
    
    /* Also adjust the row gutter if needed */
    .products-scroll .row {
        --bs-gutter-x: 4px !important;  /* 2px on each side */
    }
}

/* Customize scrollbar for better appearance */
.card-back .card-body::-webkit-scrollbar {
    width: 4px;
}

.card-back .card-body::-webkit-scrollbar-track {
    background: rgba(128, 128, 128, 0.1);
}

.card-back .card-body::-webkit-scrollbar-thumb {
    background-image: linear-gradient(45deg, #f906ac 25%, #5306f9 100%);
    border-radius: 10px;
}

/* Add this new class for smaller text in card backs */
.product-text {
    font-size: 12px !important;
}

/* For even smaller screens, reduce padding and font size further */
@media screen and (max-width: 576px) {
    .card-back {
        padding: 2px !important;
    }
    
    .product-text {
        font-size: 11px !important;
    }
}

.overflow-hidden {
    overflow-x: hidden;
}

.contact-link {
    transition: all 0.3s ease;
}

.contact-link:hover {
    opacity: 0.8;
    text-decoration: underline !important;
}

.contact-link-transition {
    transition: all 0.3s ease;
}

.letter-spacing {
    letter-spacing: 2px;
    font-size: 1.8rem;
}
@media (max-width: 768px) {
    .mobile-section-adjust {
         line-height: 1.5rem !important;
        margin-bottom: 30% !important;
    }
}

