/* KKU Official Colors */
:root {
    --kku-primary: #A73B24;
    --kku-dark: #8B2F1C;
    --kku-light: #C04A32;
    --kku-gold: #FFD700;
    --kku-light-bg: #F5E6E3;
}

/* Enhanced Hero Section - แก้ไขให้ไม่เกิน 100% ความกว้าง */
.hero-section {
    background: linear-gradient(135deg, var(--kku-primary) 0%, var(--kku-dark) 100%);
    border-radius: 30px; /* เพิ่ม border-radius กลับมา แต่ลดลง */
    margin: 30px 15px; /* ลด margin */
    position: relative;
    overflow: hidden;
    width: calc(100% - 30px); /* คำนวณความกว้างให้ไม่เกิน 100% */
    max-width: 100%;
    box-sizing: border-box;
}

/* Background decoration for hero */
.hero-decoration {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 1;
}

.hero-decoration::before {
    content: '';
    position: absolute;
    top: 100px;
    left: 100px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

/* Modern TQC Badge Design - Enhanced with Shadow and Highlights */
.tqc-badge-modern {
    position: relative;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float-gently 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    margin-left: 2rem;
    margin-right: 2rem;
}

.tqc-logo-floating {
    filter: drop-shadow(0 12px 35px rgba(0, 0, 0, 0.6)) 
            drop-shadow(0 6px 20px rgba(255, 215, 0, 0.5))
            drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3))
            brightness(1.15) 
            contrast(1.3)
            saturate(1.2);
    transition: all 0.4s ease;
    position: relative;
    z-index: 3;
    -webkit-filter: drop-shadow(0 12px 35px rgba(0, 0, 0, 0.6)) 
                    drop-shadow(0 6px 20px rgba(255, 215, 0, 0.5))
                    drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3))
                    drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

.tqc-badge-modern:hover .tqc-logo-floating {
    transform: scale(1.12) rotate(3deg);
    filter: drop-shadow(0 16px 45px rgba(0, 0, 0, 0.7)) 
            drop-shadow(0 8px 25px rgba(255, 215, 0, 0.7))
            drop-shadow(0 4px 12px rgba(255, 255, 255, 0.5))
            drop-shadow(0 0 30px rgba(255, 215, 0, 0.6))
            brightness(1.3) 
            contrast(1.4)
            saturate(1.3);
    -webkit-filter: drop-shadow(0 16px 45px rgba(0, 0, 0, 0.7)) 
                    drop-shadow(0 8px 25px rgba(255, 215, 0, 0.7))
                    drop-shadow(0 4px 12px rgba(255, 255, 255, 0.5))
                    drop-shadow(0 0 30px rgba(255, 215, 0, 0.6));
}

/* Enhanced Glowing effect behind the logo */
.tqc-glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, 
        rgba(255, 215, 0, 0.4) 0%, 
        rgba(255, 215, 0, 0.25) 20%, 
        rgba(255, 255, 255, 0.1) 40%,
        rgba(255, 215, 0, 0.15) 60%, 
        rgba(255, 215, 0, 0.05) 80%, 
        transparent 100%);
    border-radius: 50%;
    z-index: 1;
    opacity: 0.9;
    animation: enhanced-pulse-glow 2.5s ease-in-out infinite alternate;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3),
                inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.tqc-badge-modern:hover .tqc-glow-effect {
    animation: enhanced-pulse-glow-fast 1.2s ease-in-out infinite alternate;
    background: radial-gradient(circle, 
        rgba(255, 215, 0, 0.5) 0%, 
        rgba(255, 215, 0, 0.3) 20%, 
        rgba(255, 255, 255, 0.15) 40%,
        rgba(255, 215, 0, 0.2) 60%, 
        rgba(255, 215, 0, 0.1) 80%, 
        transparent 100%);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.5),
                inset 0 0 30px rgba(255, 255, 255, 0.3);
}

/* เพิ่ม pseudo-element สำหรับไฮไลท์เพิ่มเติม */
.tqc-badge-modern::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: conic-gradient(from 0deg, 
        transparent 0deg, 
        rgba(255, 215, 0, 0.3) 60deg, 
        transparent 120deg, 
        rgba(255, 255, 255, 0.2) 180deg, 
        transparent 240deg, 
        rgba(255, 215, 0, 0.3) 300deg, 
        transparent 360deg);
    border-radius: 50%;
    z-index: 0;
    opacity: 0.6;
    animation: rotate-highlight 8s linear infinite;
    filter: blur(3px);
}

.tqc-badge-modern:hover::before {
    opacity: 1;
    animation: rotate-highlight-fast 4s linear infinite;
    filter: blur(2px);
}

/* เพิ่ม inner highlight */
.tqc-badge-modern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.3) 0%,
        transparent 30%,
        transparent 70%,
        rgba(255, 215, 0, 0.2) 100%);
    border-radius: 50%;
    z-index: 2;
    opacity: 0.7;
    animation: shimmer 3s ease-in-out infinite;
}

/* Enhanced buttons with rounded corners - ลดขนาดลง */
.btn-kku-gold {
    background: linear-gradient(135deg, var(--kku-gold) 0%, #f1c40f 100%);
    color: var(--kku-dark);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 60px !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    padding: 10px 20px !important; /* ลดจาก default */
    font-size: 0.9rem !important; /* ลดขนาดฟอนต์ */
}

.btn-kku-gold:hover {
    background: linear-gradient(135deg, #f1c40f 0%, #e6c200 100%);
    color: var(--kku-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* ปุ่มดาวน์โหลด E-book (สีเขียว) - ลดขนาดลง */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 60px !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    padding: 10px 20px !important; /* ลดจาก default */
    font-size: 0.9rem !important; /* ลดขนาดฟอนต์ */
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea080 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* ปุ่มดาวน์โหลด PDF (สีแดง) - ลดขนาดลง */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 60px !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    padding: 10px 20px !important; /* ลดจาก default */
    font-size: 0.9rem !important; /* ลดขนาดฟอนต์ */
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #c0392b 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

/* Enhanced Quality Circle - More Prominent */
.quality-circle {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 6px solid var(--kku-gold) !important; /* เพิ่มจาก 5px เป็น 6px */
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%) !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(167, 59, 36, 0.15), 
                0 8px 20px rgba(255, 215, 0, 0.2),
                inset 0 2px 10px rgba(255, 255, 255, 0.8) !important;
}

.quality-circle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: conic-gradient(from 0deg, 
        var(--kku-gold) 0deg, 
        #f1c40f 60deg,
        var(--kku-gold) 120deg, 
        #e6c200 180deg,
        var(--kku-gold) 240deg, 
        #f1c40f 300deg,
        var(--kku-gold) 360deg);
    border-radius: 50%;
    z-index: -1;
    animation: rotate-border 8s linear infinite;
    filter: blur(1px);
}

.quality-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, 
        rgba(255, 215, 0, 0.1) 0%,
        transparent 60%);
    border-radius: 50%;
    z-index: 0;
    animation: pulse-circle 3s ease-in-out infinite;
}

.quality-circle:hover {
    transform: translateY(-20px) scale(1.05);
    box-shadow: 0 25px 60px rgba(167, 59, 36, 0.25), 
                0 15px 30px rgba(255, 215, 0, 0.3),
                inset 0 3px 15px rgba(255, 255, 255, 0.9) !important;
    border-width: 7px !important; /* เพิ่มจาก 6px เป็น 7px */
}

.quality-circle:hover::before {
    animation: rotate-border-fast 4s linear infinite;
    filter: blur(0px);
}

.quality-circle:hover::after {
    animation: pulse-circle-fast 1.5s ease-in-out infinite;
}

/* Enhanced TQC Circle Logo */
.tqc-circle-logo {
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2))
            drop-shadow(0 2px 6px rgba(255, 215, 0, 0.3));
    position: relative;
    z-index: 2;
    border-radius: 20px; /* เพิ่ม border-radius ให้โลโก้ */
}

.quality-circle:hover .tqc-circle-logo {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.3))
            drop-shadow(0 3px 10px rgba(255, 215, 0, 0.5))
            brightness(1.1);
}

/* Enhanced Text in Quality Circle */
.quality-circle h5 {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.quality-circle h6 {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    color: var(--kku-primary) !important;
}

.quality-circle small {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quality-circle:hover h5,
.quality-circle:hover h6 {
    transform: translateY(-2px);
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

.quality-circle:hover small {
    transform: translateY(-1px);
    color: var(--kku-dark) !important;
}

.border-gold {
    border: 6px solid var(--kku-gold) !important; /* เพิ่มจาก 5px เป็น 6px */
}

/* Text styling */
.hero-content h1 {
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

/* Color classes */
.text-kku-maroon {
    color: var(--kku-primary) !important;
}

/* Animation keyframes */
@keyframes float-gently {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    }
    33% { 
        transform: translateY(-10px) rotate(1deg);
        filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
    }
    66% { 
        transform: translateY(-5px) rotate(-1deg);
        filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.35));
    }
}

@keyframes enhanced-pulse-glow {
    0% { 
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.3),
                    inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    100% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 60px rgba(255, 215, 0, 0.5),
                    inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
}

@keyframes enhanced-pulse-glow-fast {
    0% { 
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.4),
                    inset 0 0 25px rgba(255, 255, 255, 0.25);
    }
    100% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 80px rgba(255, 215, 0, 0.6),
                    inset 0 0 40px rgba(255, 255, 255, 0.4);
    }
}

@keyframes rotate-highlight {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-highlight-fast {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { 
        opacity: 0.5;
        background: linear-gradient(145deg, 
            rgba(255, 255, 255, 0.2) 0%,
            transparent 30%,
            transparent 70%,
            rgba(255, 215, 0, 0.1) 100%);
    }
    50% { 
        opacity: 0.8;
        background: linear-gradient(145deg, 
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 215, 0, 0.2) 30%,
            rgba(255, 255, 255, 0.1) 70%,
            rgba(255, 215, 0, 0.3) 100%);
    }
    100% { 
        opacity: 0.5;
        background: linear-gradient(145deg, 
            rgba(255, 255, 255, 0.2) 0%,
            transparent 30%,
            transparent 70%,
            rgba(255, 215, 0, 0.1) 100%);
    }
}

@keyframes rotate-border {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-border-fast {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-circle {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% { 
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes pulse-circle-fast {
    0%, 100% { 
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% { 
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-section {
        border-radius: 20px;
        margin: 20px 10px;
        width: calc(100% - 20px);
        padding: 30px 0 !important;
    }
    
    .hero-content {
        text-align: center;
        padding: 0 15px;
        margin-top: 15px;
    }
    
    .hero-content .d-flex {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .tqc-badge-modern {
        align-self: center;
        margin-bottom: 20px;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .hero-content .d-flex.gap-3 {
        flex-direction: column;
        align-items: center;
        gap: 12px !important;
        width: 100%;
        max-width: 100%;
    }
    
    .hero-content .btn {
        width: 100%;
        max-width: 280px;
        margin-bottom: 0;
        margin-right: 0 !important;
    }
    
    .col-lg-4 {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .hero-section {
        border-radius: 15px;
        margin: 15px 5px;
        width: calc(100% - 10px);
        padding: 25px 0 !important;
    }
    
    .hero-content {
        padding: 0 10px;
    }
    
    .hero-content .btn {
        max-width: 250px;
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .hero-section {
        border-radius: 25px;
        margin: 25px 15px;
        width: calc(100% - 30px);
    }
}

/* Large desktop enhancements */
@media (min-width: 1200px) {
    .hero-section {
        border-radius: 35px;
        margin: 40px 20px;
        width: calc(100% - 40px);
    }
}

/* Extra large desktop enhancements */
@media (min-width: 1400px) {
    .hero-section {
        border-radius: 40px;
        margin: 50px 25px;
        width: calc(100% - 50px);
    }
}

/* แก้ไข container และ row ให้ไม่เกิด overflow */
.hero-section .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.hero-section .row {
    margin-left: 0;
    margin-right: 0;
}

.hero-section .col-lg-8,
.hero-section .col-lg-4 {
    padding-left: 10px;
    padding-right: 10px;
}

/* ปรับปรุงปุ่มให้ไม่เกิด overflow */
.hero-content .d-flex.gap-3 {
    max-width: 100%;
    overflow: hidden;
}

.hero-content .btn {
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* แก้ไข icon spacing */
.hero-content .btn i {
    margin-right: 8px;
}

/* ปรับปรุง quality circle ให้ responsive */
.quality-circle {
    max-width: 100%;
    width: 280px !important;
    height: 280px !important;
}

@media (max-width: 992px) {
    .quality-circle {
        width: 250px !important;
        height: 250px !important;
    }
}

@media (max-width: 768px) {
    .quality-circle {
        width: 200px !important;
        height: 200px !important;
    }
}