/* General Styling */
:root {
    --primary-color: #007bff; /* Blue */
    --secondary-color: #6c757d; /* Gray */
    --accent-color: #28a745; /* Green */
    --dark-color: #343a40; /* Dark Gray */
    --light-color: #f8f9fa; /* Light Gray */
    --white-color: #ffffff;
    --text-color: #333;
    --link-color: #007bff;
    --border-radius: 8px;
    --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--link-color);
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

ul {
    list-style: none;
}

h1, h2, h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

p {
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background: darken(var(--primary-color), 10%);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-primary-outline:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: darken(var(--secondary-color), 10%);
}

.btn-shopee {
    background-color: #EE4D2D; /* Shopee Orange */
    color: var(--white-color);
    font-weight: bold;
    padding: 12px 25px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-shopee:hover {
    background-color: darken(#EE4D2D, 10%);
    text-decoration: none;
}

.btn-shopee i {
    margin-right: 8px;
}

.section-padded {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--light-color);
}

.bg-dark {
    background-color: var(--dark-color);
    color: var(--white-color);
}

.bg-dark h2, .bg-dark label {
    color: var(--white-color);
}

/* Header */
header {
    background: var(--dark-color);
    color: var(--white-color);
    padding: 20px 0;
    box-shadow: var(--box-shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a {
    color: var(--white-color);
    font-size: 2rem;
    font-weight: 700;
}

header nav ul {
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    color: var(--white-color);
    font-weight: 400;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Hero Section */
#hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/arduino-hero.jpg') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 100px 0;
}

#hero h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--white-color);
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Code Grid */
.code-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.code-card, .product-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.code-card:hover, .product-card:hover {
    transform: translateY(-5px);
}

.code-card img, .product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.code-card h3, .product-card h3 {
    padding: 15px 15px 0;
    font-size: 1.4rem;
    min-height: 60px; /* Ensure consistent height for titles */
}

.code-card p, .product-card p.product-description {
    padding: 0 15px;
    font-size: 0.95rem;
    color: #666;
    flex-grow: 1; /* Make description take available space */
}

.code-card .code-meta {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    font-size: 0.85rem;
    color: #888;
}

.code-card .btn {
    width: calc(100% - 30px); /* Adjust for padding */
    margin: 15px;
    text-align: center;
}

/* Product Card specific styling */
.product-card .product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    padding: 10px 15px;
}

.product-card .btn-shopee {
    width: calc(100% - 30px);
    margin: 15px;
}

.shopee-affiliate-banner {
    margin-top: 40px;
    text-align: center;
}

/* Video Section */
#video-tutorials .video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

#video-tutorials .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#video-tutorials .video-description {
    text-align: center;
    margin-top: 20px;
    font-size: 1.1rem;
    color: #555;
}

#video-tutorials .btn-primary-outline {
    display: block;
    width: fit-content;
    margin: 30px auto 0;
    font-size: 1.1rem;
}








/* Footer */
footer {
    background: var(--dark-color);
    color: var(--white-color);
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

footer p {
    margin-bottom: 15px;
}

footer .social-links a {
    color: var(--white-color);
    font-size: 1.8rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

footer .social-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    header nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    header nav ul li {
        margin: 5px 10px;
    }

    #hero h2 {
        font-size: 2.5rem;
    }

    .code-grid, .product-grid {
        grid-template-columns: 1fr;
    }

    .section-padded {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    #hero {
        padding: 60px 0;
    }

    #hero h2 {
        font-size: 2rem;
    }

    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    header nav ul li {
        margin: 5px;
    }
}

/*สภาพอากาศ*/

