@import url('https://fonts.googleapis.com/css2?family=Kanit&display=swap');

/* main.css */
body {
    font-family: 'Kanit', sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2e7d32, #c0a040);
}

h1 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2e7d32, #c0a040);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 25px 0 20px 0;
    letter-spacing: -0.02em;
}

h1 i {
    background: linear-gradient(135deg, #2e7d32, #c0a040);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 12px;
    font-size: 2rem;
}

.knowless-search {
    display: flex;
    gap: 12px;
    margin: 0 30px 30px 30px;
    flex-wrap: wrap;
    align-items: center;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 2px solid rgba(46, 125, 50, 0.2);
    border-radius: 40px;
    font-size: 0.9rem;
    font-family: 'Kanit', sans-serif;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.2);
    transform: translateY(-1px);
}

.search-select {
    padding: 12px 20px;
    border: 2px solid rgba(46, 125, 50, 0.2);
    border-radius: 40px;
    font-size: 0.9rem;
    font-family: 'Kanit', sans-serif;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    min-width: 160px;
}

.search-select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.2);
    transform: translateY(-1px);
}

.knowless-read {
    background: linear-gradient(135deg, #2e7d32, #c0a040);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Kanit', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.knowless-read::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s;
}

.knowless-read:hover::before {
    left: 100%;
}

.knowless-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(46, 125, 50, 0.4);
}

.knowless-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 0 30px 30px 30px;
}

.knowless-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    position: relative;
}

.knowless-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2e7d32, #c0a040);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.knowless-card:hover::before {
    opacity: 1;
}

.knowless-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.knowless-cover {
    position: relative;
    overflow: hidden;
    height: 180px;
}

.knowless-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.knowless-card:hover .knowless-cover img {
    transform: scale(1.05);
}

.knowless-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1), rgba(192, 160, 64, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.knowless-card:hover .knowless-cover::after {
    opacity: 1;
}

.knowless-body {
    padding: 18px;
}

.knowless-meta {
    margin-bottom: 12px;
}

.knowless-category {
    background: linear-gradient(135deg, #2e7d32, #c0a040);
    color: white;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 12px rgba(46, 125, 50, 0.3);
}

.knowless-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.knowless-detail {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.card-footer .knowless-read {
    padding: 10px 20px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #2e7d32, #c0a040);
    box-shadow: 0 5px 16px rgba(46, 125, 50, 0.3);
}

.card-footer .knowless-read:hover {
    box-shadow: 0 8px 25px rgba(192, 160, 64, 0.4);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-results h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.no-results::before {
    content: '📚';
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.04), rgba(192, 160, 64, 0.04));
    animation: float 8s ease-in-out infinite;
}

.floating-circle:nth-child(1) {
    width: 70px;
    height: 70px;
    top: 12%;
    right: 8%;
    animation-delay: 0s;
}

.floating-circle:nth-child(2) {
    width: 50px;
    height: 50px;
    bottom: 18%;
    left: 10%;
    animation-delay: 3s;
}

.floating-circle:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 55%;
    right: 18%;
    animation-delay: 6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 16px;
    }

    h1 {
        font-size: 1.8rem;
        margin: 20px 0 16px 0;
    }

    h1 i {
        font-size: 1.6rem;
        margin-right: 8px;
    }

    .knowless-search {
        margin: 0 16px 24px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .search-container {
        min-width: auto;
    }

    .search-select {
        width: 100%;
        min-width: auto;
    }

    .knowless-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px 24px 16px;
    }

    .knowless-cover {
        height: 150px;
    }

    .knowless-body {
        padding: 14px;
    }

    .knowless-title {
        font-size: 1rem;
    }

    .knowless-detail {
        font-size: 0.85rem;
    }
}

/* ================= DARK MODE ================= */
body.dark-mode {
  background: #121212 !important;
  color: #ddd !important;
}

/* Container */
body.dark-mode .container {
  background: rgba(26, 26, 26, 0.95) !important;
  border: 1px solid rgba(192, 160, 64, 0.25) !important;
  box-shadow: 0 15px 40px rgba(192, 160, 64, 0.08) !important;
  color: #eee !important;
}

body.dark-mode .container::before {
  background: linear-gradient(90deg, #c0a040, #2e7d32) !important;
}

/* Heading */
body.dark-mode h1 {
  background: linear-gradient(135deg, #c0a040, #2e7d32);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.dark-mode h1 i {
  background: linear-gradient(135deg, #c0a040, #2e7d32);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Search Input & Select */
body.dark-mode .search-input {
  background: #1a1a1a !important;
  border: 2px solid rgba(192, 160, 64, 0.3) !important;
  color: #eee !important;
}

body.dark-mode .search-input:focus {
  border-color: #c0a040 !important;
  box-shadow: 0 6px 20px rgba(192, 160, 64, 0.2) !important;
}

body.dark-mode .search-select {
  background: #1a1a1a !important;
  border: 2px solid rgba(192, 160, 64, 0.3) !important;
  color: #eee !important;
}

body.dark-mode .search-select:focus {
  border-color: #c0a040 !important;
  box-shadow: 0 6px 20px rgba(192, 160, 64, 0.25) !important;
}

/* Button */
body.dark-mode .knowless-read {
  background: linear-gradient(135deg, #c0a040, #9c7a2e) !important;
  color: #121212 !important;
  box-shadow: 0 6px 20px rgba(192, 160, 64, 0.3) !important;
}

body.dark-mode .knowless-read:hover {
  background: linear-gradient(135deg, #9c7a2e, #7a5d20) !important;
  box-shadow: 0 12px 30px rgba(192, 160, 64, 0.4) !important;
}

/* Card */
body.dark-mode .knowless-card {
  background: rgba(26, 26, 26, 0.9) !important;
  border: 1px solid rgba(192, 160, 64, 0.2) !important;
  box-shadow: 0 8px 25px rgba(192, 160, 64, 0.08) !important;
}

body.dark-mode .knowless-card::before {
  background: linear-gradient(90deg, #c0a040, #2e7d32) !important;
}

body.dark-mode .knowless-title {
  color: #eee !important;
}

body.dark-mode .knowless-detail {
  color: #aaa !important;
}

body.dark-mode .knowless-category {
  background: linear-gradient(135deg, #c0a040, #9c7a2e) !important;
  color: #121212 !important;
}

/* Card Footer */
body.dark-mode .card-footer {
  border-top: 1px solid rgba(192, 160, 64, 0.2) !important;
}

body.dark-mode .card-footer .knowless-read {
  background: linear-gradient(135deg, #c0a040, #7a5d20) !important;
  color: #121212 !important;
}

/* No Results */
body.dark-mode .no-results {
  color: #aaa !important;
}

body.dark-mode .no-results::before {
  opacity: 0.3 !important;
}

/* Floating elements */
body.dark-mode .floating-circle {
  background: linear-gradient(135deg, rgba(192, 160, 64, 0.06), rgba(46, 125, 50, 0.06));
}
