/* =================================
   CSS สำหรับเว็บไซต์วิทยาการคำนวณ
   Version: Simplified (No Heavy Animations)
   ================================= */

/* === Google Fonts === */
:root {
    --font-primary: 'Prompt', sans-serif;
    --font-secondary: 'Sarabun', sans-serif;
    
    /* Colors */
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8f9fa;
    --dark: #1f2937;
    
    /* Gradients */
    --gradient-blue: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-purple: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* === Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--dark);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.3;
}

a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* === Navbar Styles === */
.navbar {
    padding: 1rem 0;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

/* === Hero Section === */
.hero-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Remove heavy animations */
.animate-fade-in {
    opacity: 1;
}

.animate-float {
    /* Animation removed */
}

/* === Code Window === */
.code-window {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.code-header {
    background: #323232;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.code-body {
    padding: 20px;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.code-body pre {
    margin: 0;
    white-space: pre-wrap;
}

.code-keyword { color: #c586c0; }
.code-function { color: #dcdcaa; }
.code-string { color: #ce9178; }
.code-number { color: #b5cea8; }
.code-comment { color: #6a9955; }

/* === Feature Box === */
.feature-box {
    padding: 2rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.feature-box:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Remove fade-in animation */
.feature-box.fade-in {
    opacity: 1;
}

.icon-box {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: white;
}

.bg-gradient-blue { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.bg-gradient-purple { background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%); }
.bg-gradient-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

/* === Lesson Cards === */
.lesson-card {
    transition: box-shadow 0.2s ease;
}

/* Remove fade-in animation */
.lesson-card.fade-in {
    opacity: 1;
}

.lesson-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.lesson-number {
    font-size: 3rem;
    font-weight: 700;
    opacity: 0.3;
}

.shadow-hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.shadow-hover:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* === Lesson Card Horizontal === */
.lesson-card-horizontal {
    transition: box-shadow 0.2s ease;
}

.lesson-card-horizontal:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.lesson-thumbnail {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Button Styles === */
.btn {
    font-family: var(--font-primary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: opacity 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* === Page Header === */
.page-header {
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

/* === Lesson Header === */
.lesson-header {
    position: relative;
    overflow: hidden;
}

/* === Content Section === */
.content-section {
    position: relative;
}

.section-number {
    position: absolute;
    left: -60px;
    top: 0;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.1;
}

/* === Example Box === */
.example-box {
    border-left: 4px solid var(--warning);
}

/* === Code Example Card === */
.code-example-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.code-header {
    background: #f3f4f6;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.code-language {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
}

.code-body {
    background: #1e1e1e;
    padding: 20px;
    overflow-x: auto;
}

.code-body code {
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.code-output {
    background: #000;
    color: #0f0;
    padding: 15px 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border-top: 1px solid #333;
}

.output-label {
    color: #888;
    font-size: 12px;
    margin-bottom: 8px;
}

/* === Flowchart Symbols === */
.flowchart-symbol {
    width: 180px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--dark);
    font-weight: 500;
    font-size: 0.9rem;
    background: white;
}

.flowchart-symbol.oval {
    border-radius: 40px;
}

.flowchart-symbol.rectangle {
    border-radius: 8px;
}

.flowchart-symbol.parallelogram {
    transform: skew(-20deg);
    border-radius: 4px;
}

.flowchart-symbol.parallelogram span {
    transform: skew(20deg);
}

.flowchart-symbol.diamond {
    width: 100px;
    height: 100px;
    transform: rotate(45deg);
    border-radius: 8px;
}

.flowchart-symbol.diamond span {
    transform: rotate(-45deg);
}

.flowchart-symbol.arrow {
    border: none;
    font-size: 2rem;
}

.flowchart-symbol.connector {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.flowchart-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 10px 0;
}

.flowchart-container {
    display: inline-block;
    max-width: 100%;
}

/* === Symbol Card === */
.symbol-card {
    transition: box-shadow 0.2s ease;
}

.symbol-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* === Assessment Styles === */
.assessment-card {
    transition: box-shadow 0.2s ease;
}

.assessment-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
}

.assessment-icon {
    font-size: 3rem;
}

.assessment-info {
    font-size: 0.95rem;
}

.sample-question {
    transition: background 0.2s ease;
}

.sample-question:hover {
    background: #f9fafb;
    padding: 1rem;
    margin: -1rem;
    border-radius: 0.5rem;
}

/* === Contact Styles === */
.contact-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-item {
    /* Removed hover animation */
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: opacity 0.2s ease;
}

.social-link:hover {
    opacity: 0.8;
}

.social-link.facebook { background: #1877f2; }
.social-link.youtube { background: #ff0000; }
.social-link.line { background: #00b900; }
.social-link.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-link.twitter { background: #000; }

/* === Sidebar === */
.sticky-sidebar {
    position: sticky;
    top: 100px;
}

.lesson-nav .nav-link {
    color: var(--dark);
    padding: 0.5rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.lesson-nav .nav-link:hover {
    background: #f3f4f6;
    border-left-color: var(--primary);
    color: var(--primary);
}

/* === Footer === */
.text-light-gray {
    color: #d1d5db;
}

.hover-link {
    transition: color 0.2s ease;
}

.hover-link:hover {
    color: white !important;
}

.bg-darker {
    background: #111827;
}

.social-icons a {
    transition: opacity 0.2s ease;
}

.social-icons a:hover {
    opacity: 0.8;
}

/* === Utilities === */
.min-vh-75 {
    min-height: 75vh;
}

.bg-gradient-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* === Responsive === */
@media (max-width: 991.98px) {
    .section-number {
        position: relative;
        left: 0;
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .sticky-sidebar {
        position: relative;
        top: 0;
    }
    
    .lesson-thumbnail {
        min-height: 200px;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .code-window {
        font-size: 12px;
    }
    
    .flowchart-symbol {
        width: 140px;
        height: 60px;
        font-size: 0.8rem;
    }
}

/* === Print Styles === */
@media print {
    .navbar,
    .footer,
    .btn,
    .sticky-sidebar {
        display: none !important;
    }
    
    .content-section {
        page-break-inside: avoid;
    }
}

/* === Smooth Scroll === */
html {
    scroll-behavior: smooth;
}

/* === Focus Styles === */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* === Card Styles === */
.card {
    border-radius: 0.75rem;
}

.card-header {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

/* === Badge Styles === */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* === Alert Styles === */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* === Form Styles === */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    transition: border-color 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* === Table Styles === */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead {
    background: var(--light);
}

/* === Modal Styles === */
.modal-content {
    border-radius: 1rem;
    border: none;
}

.modal-header {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

/* === Accordion Styles === */
.accordion-item {
    border-radius: 0.5rem;
    overflow: hidden;
}

.accordion-button {
    font-weight: 500;
    transition: background 0.2s ease;
}

.accordion-button:not(.collapsed) {
    background: var(--light);
    color: var(--primary);
}

/* === Code Blocks === */
code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #dc2626;
}

pre code {
    background: transparent;
    padding: 0;
}

/* === Lists === */
ul, ol {
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* === Images === */
img {
    max-width: 100%;
    height: auto;
}

/* === Loading State === */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* === Disabled State === */
.disabled,
[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}