/* General resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    line-height: 1.6;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top bar */
.top-bar {
    background-color: #0082d6; /* updated from orange to iKey blue */
    color: #fff;
    font-size: 0.8rem;
    padding: 6px 0;
}

.top-bar .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.top-bar .contact-info span {
    margin-right: 20px;
}

.top-bar .social-icons a {
    color: #fff;
    margin-left: 10px;
    transition: opacity 0.3s ease;
}

.top-bar .social-icons a:hover {
    opacity: 0.7;
}

/* Navigation */
.main-header {
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.logo-key { color: #000; }
 .logo-num { color: #0082d6; margin: 0 3px; }
.logo-card { color: #000; }

/* Ensure logo image scales properly */
.logo img {
    display: block;
    /* enlarge logo in navigation bar */
    height: 80px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 20px;
    font-weight: 500;
}

.nav-menu a {
    color: #333;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #0082d6;
}

.btn-line {
    border: 2px solid #0082d6;
    padding: 6px 18px;
    border-radius: 25px;
    color: #0082d6;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-line:hover {
    background-color: #0082d6;
    color: #fff;
}

/* Hero section */
.hero {
    position: relative;
    /* Updated hero gradient to blue tones */
    background: linear-gradient(135deg, #0082d6, #00a0f5);
    color: #fff;
    padding: 80px 0;
    overflow: hidden;
}

.hero-shapes {
    position: absolute;
    top: -100px;
    right: -200px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(45deg);
    pointer-events: none;
}

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

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-content h1 span {
    color: #ffcc33;
}

.hero-content p {
    max-width: 600px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-images {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.hero-images .circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.hero-images .circle img {
    width: 80%;
    height: auto;
}

/* Features */
.features {
    padding: 60px 0;
    background-color: #fff;
}

.features-grid {
    display: grid;
    /* Display six feature items in two rows of three columns on desktop */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: center;
}

/* Responsive layout for the features grid on smaller screens */
@media (max-width: 768px) {
    .features-grid {
        /* Stack items in two columns on tablets */
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .features-grid {
        /* Stack items vertically on very narrow screens */
        grid-template-columns: 1fr;
    }
}

.feature-item {
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-item i {
    font-size: 2.5rem;
    color: #0082d6;
    margin-bottom: 10px;
}

.feature-item h3 {
    font-size: 1.1rem;
    color: #0082d6;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Style for feature images */
.feature-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px auto;
}

.feature-item p {
    font-size: 0.9rem;
    color: #555;
}

/* About */
.about {
    padding: 80px 0;
    background-color: #fafafa;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 1 1 50%;
}

.about-text h2 {
    color: #0082d6;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
    font-size: 1rem;
}

.about-text .btn-primary {
    display: inline-block;
    background-color: #0082d6;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.about-text .btn-primary:hover {
    background-color: #006bb3;
}

.about-image {
    flex: 1 1 40%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image .circle-bg {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: #e6f4fd;
    position: absolute;
    z-index: 0;
}

.about-image .overlay-img {
    width: 160px;
    position: relative;
    z-index: 1;
}

/* New style for advertisement image in about section */
.about-image img.about-adv-img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Process */
.process {
    padding: 80px 0;
    background-color: #fff;
}

.process h2 {
    text-align: center;
    margin-bottom: 50px;
    color: #0082d6;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: #fafafa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.step i {
    font-size: 2.2rem;
    color: #0082d6;
    margin-bottom: 10px;
}

.step h4 {
    color: #0082d6;
    margin-bottom: 8px;
    font-size: 1rem;
}

.step p {
    font-size: 0.9rem;
    color: #555;
}

/* Online System */
.online-system {
    /* Updated online system section to light blue background */
    background-color: #e6f4fd;
    color: #333;
    text-align: center;
    padding: 60px 20px;
}

.online-system h2 {
    margin-bottom: 10px;
    font-size: 2rem;
}

.online-system p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Care Section */
.care {
    padding: 80px 0;
    background-color: #e6f4fd;
}

.care-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.care-text {
    flex: 1 1 50%;
}

.care-text h2 {
    color: #0082d6;
    margin-bottom: 20px;
}

.care-text p {
    font-size: 1rem;
    margin-bottom: 15px;
}

.care-image {
    flex: 1 1 40%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.care-image .circle-bg {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #ffdab6;
    position: absolute;
    z-index: 0;
}

.care-image .overlay-img {
    width: 140px;
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background-color: #202020;
    color: #ccc;
    padding: 60px 0 30px;
}

/* Floating social icons on the side */
.floating-icons {
    position: fixed;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}
.floating-icons a {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Ensure images inside floating icons fill the circle */
.floating-icons a img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Generic page content */
.page-content {
    padding: 80px 0;
}

.page-content h1 {
    color: #0082d6;
    margin-bottom: 20px;
    font-size: 2rem;
    text-align: left;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
}

.footer-logo {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-logo span {
    color: #0082d6;
}

.footer h4 {
    color: #fff;
    margin-bottom: 10px;
    font-weight: 600;
}

.footer p, .footer ul li {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #ccc;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #0082d6;
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 15px;
    font-size: 0.8rem;
}

/* Sample Reviews Section */
/* Articles Section */
.articles {
    padding: 60px 0;
    background-color: #f5faff;
}
.article-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}
.article-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 340px;
    text-align: left;
}
.article-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 12px;
}
.article-card h3 {
    font-size: 1.2rem;
    color: #0082d6;
    margin-bottom: 10px;
    font-weight: 600;
}
.article-card p {
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.4rem;
    }
    .nav-menu {
        display: none; /* hide nav links on small screens */
    }
    .btn-line {
        display: none;
    }
    .about-content, .care-content {
        flex-direction: column;
        text-align: center;
    }
    .about-image, .care-image {
        margin-top: 20px;
    }
}

/* Admin page styles */
.admin-container {
    padding: 60px 20px;
}

.admin-section {
    margin-bottom: 40px;
}

.admin-section h2 {
    color: #0082d6;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.admin-section textarea {
    width: 100%;
    min-height: 180px;
    padding: 10px;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}

.admin-actions {
    text-align: right;
}

.admin-actions button {
    background-color: #0082d6;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.admin-actions button:hover {
    background-color: #006bb3;
}

/* Image manager styles for admin page */
.image-manager {
    margin-top: 15px;
}
.image-manager label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}
.image-manager input[type="file"] {
    margin-bottom: 10px;
}
.image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}
.image-item {
    position: relative;
}
.image-item img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.image-item button.delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: rgba(255, 102, 0, 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

/* Page images gallery styles */
.page-images {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.page-images img {
    max-width: 300px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* iKey custom sections for the homepage */
.hero-section img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Advertisement Section */
.ads-section {
    padding: 3rem 0;
}
.ads-section .adv-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
}
.ads-section .adv-row .adv-img {
    flex: 1 1 45%;
    text-align: center;
}
.ads-section .adv-row .adv-img img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.ads-section .adv-row .adv-text {
    flex: 1 1 50%;
    padding: 1rem 2rem;
    font-size: 1rem;
    line-height: 1.6;
}
.ads-section .adv-row .adv-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #0082d6;
}
@media (max-width: 768px) {
    .ads-section .adv-row {
        flex-direction: column;
    }
    .ads-section .adv-row .adv-img,
    .ads-section .adv-row .adv-text {
        flex: 1 1 100%;
        text-align: left;
    }
    .ads-section .adv-row .adv-img {
        margin-bottom: 1rem;
    }
}

/* Service banner styling */
.service-section img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}