/* Variables */
:root {
    --primary: #008996;
    --primary-dark: #006d77;
    --secondary: #83c5be;
    --accent: #e29578;
    --text-dark: #2b2d42;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #edf6f9 0%, #ffffff 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Typography */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&display=swap');

body {
    font-family: 'Kanit', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Top Banner */
.top-banner {
    background: var(--primary-dark);
    color: white;
    padding: 0.75rem 0;
    font-size: 0.9rem;
}

.top-banner a {
    color: white;
    text-decoration: underline;
}

/* Navbar */
.navbar {
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: white;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
}

.navbar-nav {
    gap: 10px;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px !important;
    color: #333 !important;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #0056b3 !important;
}

.nav-link.active {
    color: #0056b3 !important;
    font-weight: 600;
}

/* แก้ไขสไตล์สำหรับ dropdown */
.nav-item.dropdown .nav-link:after {
    display: none;
}

.nav-item.dropdown .dropdown-toggle::after {
    margin-left: 8px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    opacity: 0.5;
}

.dropdown-menu {
    padding: 0.5rem 0;
    border-radius: 10px;
}

.dropdown-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    background-color: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    color: #6c757d;
}

.dropdown-item {
    padding: 0.7rem 1.2rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .dropdown-menu {
        width: 280px;
    }
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    margin-right: 8px;
    border-radius: 2px;
}

.btn-outline-secondary {
    border-color: #e9ecef;
    padding: 8px 12px;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.language-dropdown .dropdown-menu {
    min-width: 150px;
}

.btn-quote {
    background: linear-gradient(45deg, #0056b3, #0085ff);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-quote:hover {
    background: linear-gradient(45deg, #004494, #0074e0);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,86,179,0.2);
}

/* Mobile Menu */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        margin-top: 1rem;
    }
    
    .nav-link.active:after {
        display: none;
    }
    
    .navbar-nav {
        gap: 5px;
    }
    
    .d-flex.align-items-center {
        margin-top: 1rem;
        gap: 10px;
    }
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

/* Main Content Grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 0;
    background-color: #fff;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Slide Box */
.slide-box {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.slide-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Quick Links */
.quick-links {
    padding: 2rem;
}

.quick-links-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.menu-item i {
    color: #0d6efd;
    font-size: 1.1rem;
    margin-right: 10px;
    min-width: 20px;
    text-align: center;
}

.menu-item a {
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item a:hover {
    color: #0d6efd;
    text-decoration: none;
}

@media (max-width: 991.98px) {
    .main-content-grid {
        grid-template-columns: 1fr;
    }
    
    .slide-box {
        aspect-ratio: 16/9;
    }
}

/* Featured Banner */
.featured-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    padding: 3rem;
    color: white;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.featured-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.03)"/></svg>');
    opacity: 0.3;
}

.featured-content {
    position: relative;
    z-index: 1;
}

.featured-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.featured-description {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.featured-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.featured-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.featured-button i {
    transition: transform 0.3s;
}

.featured-button:hover i {
    transform: translateX(5px);
}

.featured-image {
    position: relative;
    z-index: 1;
}

.featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* Global Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #60a5fa;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Prompt', 'Kanit', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 10px 20px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 15px 0;
}

.navbar-brand {
    font-weight: 800;
    color: var(--primary-color);
}

.nav-link {
    font-weight: 600;
    padding: 10px 15px;
    margin: 0 5px;
    position: relative;
}

.nav-link:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover:after, .nav-link.active:after {
    width: 100%;
}

/* Main Hero Section */
.main-hero-section {
    padding: 2rem 0;
    background-color: #fff;
}

.py-4 {
    padding: 2rem 0;
}

.hero-image {
    max-width: 300px;
    display: block;
    margin-bottom: 20px;
}

.quick-links-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 5px 10px 5px 0;
    margin-right: 15px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.quick-link:hover {
    color: #0d6efd;
    text-decoration: none;
}

.quick-link i {
    color: #0d6efd;
    font-size: 1rem;
    margin-right: 5px;
}

.horizontal-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

/* Menu List Style */
.menu-list {
    margin: 0;
    padding: 0;
}

.menu-item {
    margin-bottom: 0.85rem;
}

/* Menu Links Style - Horizontal Layout */
.menu-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
}

.menu-link {
    display: inline-block;
    padding: 4px 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    font-weight: normal;
    font-size: 0.9rem;
    margin-right: 10px;
    white-space: nowrap;
    margin-bottom: 10px;
}

.menu-link:hover {
    text-decoration: none;
    color: #0d6efd;
}

.menu-link i {
    margin-right: 5px;
    color: #0d6efd;
    font-size: 1rem;
}

/* Featured Products - Clean, consolidated styles */
.product-card {
    border: 1px solid #eaeaea !important;
    border-radius: 10px !important;
    overflow: hidden;
    transition: all 0.2s ease;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    height: 100%;
    position: relative;
    padding: 0;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08) !important;
    border-color: #d9d9d9 !important;
}

.product-img-container {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    padding: 15px;
    position: relative;
}

.product-card img {
    max-height: 130px;
    max-width: 90%;
    object-fit: contain;
}

.product-card .card-body {
    padding: 15px !important;
    background-color: #fff;
    border-top: 1px solid #f5f5f5;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #002c53;
    line-height: 1.3;
    margin-bottom: 10px;
    min-height: auto;
    max-height: none;
}

.product-desc {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0091ff;
    margin-bottom: 15px;
}

.product-card .btn-primary {
    background-color: #0091ff;
    border: none;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 7px 12px;
    border-radius: 4px;
    box-shadow: none;
    transition: all 0.2s ease;
    width: 100%;
}

.product-card .btn-primary:hover {
    background-color: #0080e0;
}

.product-card .btn-outline-primary {
    border: 1px solid #0091ff;
    color: #0091ff;
    background-color: white;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 7px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 100%;
}

.product-card .btn-outline-primary:hover {
    background-color: #f5f9ff;
}

.product-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #0091ff;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 2;
}

.product-category {
    font-size: 0.7rem;
    color: #0091ff;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.product-category-badge {
    font-size: 0.7rem;
    color: #0091ff;
    font-weight: 500;
    margin-bottom: 8px;
    display: inline-block;
    background-color: #e6f4ff;
    padding: 3px 8px;
    border-radius: 4px;
}

.product-category-badge i {
    margin-right: 4px;
    font-size: 0.65rem;
}

.product-buttons {
    display: flex;
    gap: 8px;
}

/* Section Headers */
.section-header h2 {
    font-size: 1.6rem;
    color: #333;
    position: relative;
    letter-spacing: 0.5px;
}

.heading-line {
    width: 60px;
    height: 3px;
    background-color: #0066cc;
    margin: 0 auto;
}

/* Responsive styling for products */
@media (max-width: 767.98px) {
    .section-header h2 {
        font-size: 1.4rem;
    }
    
    .product-img-container {
        height: 140px;
        padding: 10px;
    }
    
    .product-card img {
        max-height: 110px;
    }
    
    .product-title {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .product-price {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .product-card .btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

@media (max-width: 575.98px) {
    .product-img-container {
        height: 120px;
    }
    
    .product-card img {
        max-height: 100px;
    }
    
    .product-title {
        font-size: 0.8rem;
    }
    
    .product-price {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .product-desc {
        display: none;
    }
}

/* Why Choose Us */
.feature-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    margin-bottom: 20px;
}

/* Quote Request */
#quote-request {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* Product Detail */
.product-detail-img {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-detail-info {
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Contact Form */
.contact-form-wrapper {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 40px;
}

.form-control {
    border-radius: 5px;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

/* Footer */
footer {
    background-color: var(--dark-gray);
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

/* Responsiveness */
@media (max-width: 992px) {
    #hero h1 {
        font-size: 2.5rem;
    }
    
    #hero {
        padding: 60px 0;
    }
    
    /* Responsive table styles */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive .table {
        width: 100%;
        min-width: 650px;
    }
}

@media (max-width: 768px) {
    #hero h1 {
        font-size: 2rem;
    }
    
    #hero {
        padding: 40px 0;
        text-align: center;
    }
    
    #hero img {
        margin-top: 30px;
    }
    
    /* Adjust table padding for mobile */
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* Admin Section Styles */
.admin-sidebar {
    background-color: var(--dark-gray);
    min-height: 100vh;
    padding: 20px 0;
}

.admin-sidebar .nav-link {
    color: white;
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 5px;
}

.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
}

.admin-sidebar .nav-link:after {
    display: none;
}

.admin-content {
    padding: 30px;
}

.admin-card {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.admin-card .card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
}

/* Rich Text Editor */
.ck-editor__editable {
    min-height: 300px;
}

/* Responsive Tables - Add these at the end */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    width: 100%;
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .table-responsive {
        border: 0;
    }
    
    .table-responsive .table {
        min-width: 650px;
    }
}

/* Fix dropdown menu display issues */
.dropdown-menu {
    z-index: 1030;
    position: absolute !important;
}

.table .dropdown {
    position: relative;
}

.table-responsive .dropdown-menu {
    position: absolute !important;
    transform: none !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    will-change: auto !important;
}

.dropdown-menu-end {
    --bs-position: end;
}

/* Additional dropdown fixes */
.table .dropdown-menu {
    min-width: 10rem;
    max-width: 16rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.table td {
    position: relative;
}

@media (max-width: 767.98px) {
    .table-responsive .dropdown {
        position: static;
    }
    
    .table-responsive .dropdown-menu {
        position: fixed !important;
        left: 5% !important;
        right: 5% !important;
        width: 90% !important;
    }
}

/* Video Card Styles */
.video-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    cursor: pointer;
}

.video-card:hover .video-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.quick-link:hover {
    color: #0d6efd;
    text-decoration: none;
}

.horizontal-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.quick-link:hover {
    color: #0d6efd;
    text-decoration: none;
}

.quick-link i {
    color: #0d6efd;
    font-size: 1rem;
    margin-right: 5px;
}

/* Section Headers */
.section-header h2 {
    font-size: 1.6rem;
    color: #333;
    position: relative;
    letter-spacing: 0.5px;
}

.heading-line {
    width: 60px;
    height: 3px;
    background-color: #0066cc;
    margin: 0 auto;
}
