@import url('https://fonts.googleapis.com/css2?family=Kanit&display=swap');

body {
    font-family: 'Kanit', sans-serif;
    background: #fff;
    color: #2e7d32;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
    background: linear-gradient(135deg, #2e7d32 0%, #c0a040 100%);
    border-radius: 24px;
    color: white;
    box-shadow: 0 20px 40px rgba(46, 125, 50, 0.2);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.header-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 2;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 32px;
    padding: 0;
    box-shadow: 0 12px 48px rgba(46, 125, 50, 0.08), 0 4px 16px rgba(192, 160, 64, 0.04);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 520px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #2e7d32, #c0a040);
    border-radius: 32px;
    padding: 3px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 24px 64px rgba(46, 125, 50, 0.15), 0 8px 32px rgba(192, 160, 64, 0.1);
}

.cover-image {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #2e7d32 0%, #c0a040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 28px 28px 0 0;
}

.cover-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.cover-icon {
    font-size: 5rem;
    color: white;
    z-index: 2;
    position: relative;
    text-shadow: 0 4px 16px rgba(0,0,0,0.3);
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.card-content {
    padding: 1.5rem;
}

.card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2e7d32;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    text-align: center;
}
.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    z-index: 3;
    backdrop-filter: blur(10px);
}

.status-badge.new {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.status-badge.updated {
    background: linear-gradient(135deg, #c0a040, #a67c00);
    box-shadow: 0 4px 12px rgba(192, 160, 64, 0.3);
}

.status-badge.download {
    background: linear-gradient(135deg, #2e7d32, #c0a040);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.card-meta {
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(46, 125, 50, 0.02);
    border-radius: 8px;
    border-left: 3px solid rgba(192, 160, 64, 0.3);
}

.meta-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.meta-value {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 600;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(46, 125, 50, 0.1);
}

.rating {
    display: flex;
    gap: 0.2rem;
}

.star {
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.3;
}

.star.active {
    opacity: 1;
    transform: scale(1.1);
}

.star:hover {
    transform: scale(1.2);
    opacity: 1;
}

.view-count {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}
.add-cover-btn {
    background: linear-gradient(135deg, #2e7d32 0%, #c0a040 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 32px rgba(46, 125, 50, 0.2);
    display: block;
    margin: 3rem auto;
    font-family: 'Kanit', sans-serif;
}

.add-cover-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(192, 160, 64, 0.3);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card {
        padding: 2rem;
    }
    
    .card h2 {
        font-size: 1.3rem;
    }
    
    .header-icon {
        font-size: 3rem;
    }
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 24px;
    padding: 3rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(46, 125, 50, 0.2);
    border: 2px solid rgba(46, 125, 50, 0.08);
}

.modal h3 {
    color: #2e7d32;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: #4a5568;
    font-weight: 500;
    font-size: 1rem;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(46, 125, 50, 0.1);
    border-radius: 12px;
    font-family: 'Kanit', sans-serif;
    transition: all 0.3s ease;
    font-size: 1rem;
    background: white;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(192, 160, 64, 0.2);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2e7d32 0%, #c0a040 100%);
    color: white;
}

.btn-secondary {
    background: rgba(46, 125, 50, 0.05);
    color: #4a5568;
    border: 2px solid rgba(46, 125, 50, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
}
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 3px solid rgba(46, 125, 50, 0.1);
    border-radius: 20px;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(46, 125, 50, 0.02);
}

.search-box input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 4px rgba(192, 160, 64, 0.2);
    background: white;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(46, 125, 50, 0.2);
    border-radius: 16px;
    background: white;
    color: #2e7d32;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: rgba(46, 125, 50, 0.05);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #2e7d32 0%, #c0a040 100%);
    color: white;
    border-color: transparent;
}

.card[data-category] {
    transition: all 0.5s ease;
}

.card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filter-buttons {
        justify-content: center;
    }
}
/* ================== Dark Mode ================== */
body.dark-mode {
  background: #121212;
  color: #e0e0e0;
}

/* Header */
body.dark-mode .header {
  background: linear-gradient(135deg, #1b5e20 0%, #8d6e00 100%);
  color: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
body.dark-mode .subtitle {
  color: #bbb;
}

/* Card */
body.dark-mode .card {
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
}
body.dark-mode .card h2 {
  color: #c0a040;
}
body.dark-mode .meta-item {
  background: rgba(255,255,255,0.05);
  border-left: 3px solid rgba(192,160,64,0.3);
}
body.dark-mode .meta-label {
  color: #aaa;
}
body.dark-mode .meta-value {
  color: #ddd;
}
body.dark-mode .view-count {
  color: #aaa;
}

/* Badge */
body.dark-mode .status-badge.new {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
}
body.dark-mode .status-badge.updated {
  background: linear-gradient(135deg, #c0a040, #a67c00);
}
body.dark-mode .status-badge.download {
  background: linear-gradient(135deg, #2e7d32, #c0a040);
}

/* Buttons */
body.dark-mode .add-cover-btn {
  background: linear-gradient(135deg, #2e7d32 0%, #c0a040 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
body.dark-mode .filter-btn {
  background: #1a1a1a;
  border: 2px solid #444;
  color: #ccc;
}
body.dark-mode .filter-btn:hover {
  background: #2e7d32;
  color: #fff;
}
body.dark-mode .filter-btn.active {
  background: linear-gradient(135deg, #2e7d32, #c0a040);
  color: #fff;
}

/* Controls */
body.dark-mode .search-box input {
  background: #1a1a1a;
  border: 2px solid #444;
  color: #eee;
}
body.dark-mode .search-box input:focus {
  border-color: #2e7d32;
  background: #121212;
  box-shadow: 0 0 0 3px rgba(192,160,64,0.3);
}

/* Modal */
body.dark-mode .modal-content {
  background: #1a1a1a;
  border: 1px solid #444;
  color: #eee;
}
body.dark-mode .modal h3 {
  color: #c0a040;
}
body.dark-mode .form-group label {
  color: #bbb;
}
body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
  background: #121212;
  border: 2px solid #333;
  color: #eee;
}
body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(192,160,64,0.2);
}
body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #2e7d32 0%, #c0a040 100%);
  color: #fff;
}
body.dark-mode .btn-secondary {
  background: #1a1a1a;
  border: 2px solid #444;
  color: #ccc;
}
