/* ========== 1. Reset cơ bản ========== */
* {
    margin: 0;
    padding: 0;
    /*box-sizing: border-box;*/
    font-family: Arial, sans-serif;
}

/* ========== 2. Body ========== */
body {
    background-color: #e8f5e9;
}

/* ========== 3. Header ========== */
header {
    background-color: #5abe37;
    color: white;
    width: 100%;
    top: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: center;
}
.header-wrapper {
    max-width: 950px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========== 4. Auth Buttons & Menu Toggle ========== */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}
.auth-buttons a {
    padding: 5px 15px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}
.register-btn {
    background: #4CAF50;
    color: white;
    border: 2px solid #4CAF50;
}
.login-btn {
    background: #2196F3;
    color: white;
    border: 2px solid #2196F3;
}
.register-btn:hover {
    background: #45a049;
    border-color: #45a049;
}
.login-btn:hover {
    background: #1976D2;
    border-color: #1976D2;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

/* ========== 5. Container0 (Tabs) ========== */
.container0 {
    display: flex;
    gap: 10px;
    max-width: 950px;
    margin: 15px auto 0;
    justify-content: flex-start;
    padding-left: 20px;
    flex-wrap: wrap; /* allow wrap on small */
}
.container0 button {
    background-color: limegreen;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.container0 button:hover {
    background-color: limegreen;
}
.container0 button.active {
    background-color: orange;
    color: white;
}

/* ========== 6. Semester Tag ========== */
.semester-tag {
    margin: 20px 0;
}

/* ========== 7. Grid Containers ========== */
.container {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    max-width: 950px;
    margin: 0 auto;
}
.twocolum {
    display: block;
    grid-template-columns: repeat(2, 1fr);
    max-width: 950px;
}
.container.active {
    display: grid;
}
.subject-column {
    padding: 20px;
    border-radius: 10px;
}
.subject-column h2 {
    color: #2e7d32;
    margin-bottom: 15px;
    padding-bottom: 10px;
}
.exam-list li {
    margin-bottom: 10px;
}

/* ========== 8. Links & Tags ========== */
a {
    text-decoration: underline;
    color: black;
    cursor: pointer;
}
a:hover {
    color: #1b5e20;
    text-decoration: none;
    font-weight: bold;
}
.new-tag {
    color: #e53935;
    font-weight: bold;
    font-size: 0.9em;
    margin-left: 8px;
    background-color: #fff9e6;
    padding: 2px 8px;
    border-radius: 4px;
    animation: blink 1s infinite ease-in-out;
    border: 1px solid #ffd700;
}
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ========== 9. Loading & Error ========== */
.loading, .error {
    padding: 2rem;
    text-align: center;
    font-size: 1.2rem;
    color: #666;
}
.error {
    color: #d32f2f;
}

/* ========== 10. Auth Form Container ========== */
.auth-form-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}
.auth-form label {
    display: block;
    margin: 10px 0 5px;
}
.auth-form input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    margin-bottom: 15px;
}
.auth-form .btn {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    border: none;
    border-radius: 4px;
    background: #4CAF50;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}
.auth-form .btn:hover {
    background: #45a049;
}



.mini-frame {
    border-radius: 3px;
    /* width: 200px; */
    height: 50px;
    background: linear-gradient(to bottom, #87CEEB, #E0F7FA);
    /* border-radius: 8px; */
    position: relative;
    /* overflow: hidden; */
    /* border: 4px solid #FFA500; */
    /* box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); */
    display: flex;
    justify-content: center;
    align-items: center;
}
        
    .mini-title {
        font-family: sans-serif;
        font-size: 25px;
        font-weight: bold;
        color: #FF5722;
        text-align: center;
        z-index: 2;
        text-shadow: 1px 1px 0 #FFEB3B;
        position: relative;
    }
    
    .mini-sun {
        position: absolute;
        top: 5px;
        left: 10px;
        width: 20px;
        height: 20px;
        background: #FFEB3B;
        border-radius: 50%;
        box-shadow: 0 0 5px #FFEB3B;
        z-index: 1;
    }
    
    .mini-cloud-right {
        position: absolute;
        width: 40px;
        height: 15px;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 15px;
        top: 15px;
        right: 10px;
        z-index: 1;
    }
    
    .mini-cloud-right:before {
        content: '';
        position: absolute;
        width: 12px;
        height: 12px;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 50%;
        top: -6px;
        left: 8px;
    }
    
    .mini-cloud-center {
        position: absolute;
        width: 50px;
        height: 18px;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 15px;
        top: 30px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }
    
    .mini-cloud-center:before {
        content: '';
        position: absolute;
        width: 15px;
        height: 15px;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 50%;
        top: -7px;
        left: 10px;
    }
    
    .mini-sea {
        position: absolute;
        bottom: 0;
        width: 100%;
        height: 20px;
        background: #1E88E5;
        z-index: 0;
    }
    
    .mini-wave {
        position: absolute;
        top: -3px;
        width: 100%;
        height: 5px;
background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 10" xmlns="http://www.w3.org/2000/svg"><path d="M0,5 C30,-5 70,15 100,5 C130,-5 170,15 200,5 L200,10 L0,10 Z" fill="%231E88E5" opacity="0.6"/></svg>');
        background-size: 200px 10px;
    }

/* ========== 11. Footer ========== */
footer {
    background-color: #e1e1e1;
    color: #444;
    text-align: center;
    padding: 15px;
    width: 100%;
}
@media (min-device-width: 768px) {

 .nolog {
     display: none;
 }    
    
}
/* ========== 12. Media Queries (Mobile) ========== */
@media (max-device-width: 768px) {
    .header-wrapper {
    max-width: unset;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
    /* Header menu */
    .auth-buttons a { display: none; }
    .menu-toggle { display: block; }
    .auth-buttons.open a {
        display: block;
        margin: 10px 0;
    }
    .auth-form-container {
        margin: 30px 20px;
        padding: 20px;
    }

    /* Container0 wrap */
    .container0 {
        justify-content: flex-start;
        padding-left: 0;
        margin: 15px 20px 0;
    }

    /* Grid → list */
    .container {
        display: none; /* vẫn ẩn nếu chưa active */
        grid-template-columns: 1fr;
        margin: 0 20px;
    }
    
    .container.active {
        display: grid;
    }
    .subject-column {
        padding: 15px;
    }
    .exam-list {
        padding-left: 20px;
    }
}
        /* Hiệu ứng loading */
        .skeleton-loader {
            background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
            background-size: 200% 100%;
            border-radius: 8px;
            height: 80px;
            margin: 10px 0;
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }
    
    .auth-buttons {
        display: flex;
        gap: 15px;
        margin-left: auto;
    }

    .register-btn, .login-btn {
        padding: 5px 15px;
        border-radius: 25px;
        text-decoration: none;
        font-weight: bold;
        transition: all 0.3s ease;
    }

    .register-btn {
        background: #4CAF50;
        color: white;
        border: 2px solid #4CAF50;
    }

    .login-btn {
        background: #2196F3;
        color: white;
        border: 2px solid #2196F3;
    }

    .register-btn:hover {
        background: #45a049;
        border-color: #45a049;
    }

    .login-btn:hover {
        background: #1976D2;
        border-color: #1976D2;
    }
    .menu-toggle {
        color: white;
    }
    
    

/* Dropdown styles */
.auth-buttons .dropdown {
    position: relative;
}

.auth-buttons .user-menu {
    background: white;
    color: black;
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid #4CAF50;
    position: relative;
}

.auth-buttons .dropdown::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}
/*.auth-buttons .user-menu:hover {*/
/*    background: #45a049;*/
/*    border-color: #45a049;*/
/*}*/

.auth-buttons .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    margin-top: 8px;
    text-align: left;
}

.auth-buttons .dropdown:hover .dropdown-content {
    display: block;
}

.auth-buttons .dropdown-item {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.auth-buttons .dropdown-item:hover {
    background: #f5f5f5;
    color: #000;
}

.auth-buttons .dropdown-item.logout {
    color: #e74c3c;
}

.auth-buttons .dropdown-item.logout:hover {
    background: #fdecea;
}
/*--------------------------------------*/
/* CSS cho slideshow */
.slideshow-container {
    max-width: 910px;
    position: relative;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 12px;
}

.slides-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out; /* Hiệu ứng trượt */
}

.mySlides {
    flex: 0 0 100%;
    width: 100%;
    min-height: 100%; /* Đảm bảo chiều cao đầy đủ */
}

.mySlides img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

/* Nút điều khiển */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    user-select: none;
    /*background: rgba(0,0,0,0.3);*/
    border-radius: 0 5px 5px 0;
    text-decoration: none;
}

.next {
    right: 0;
    border-radius: 5px 0 0 5px;
}

.prev:hover, .next:hover {
    /*background: rgba(0,0,0,0.8);*/
}
/* Khung bao ngoài của từng mục */

/* Danh sách từng item */
.grade-list-item {
  list-style: none;
  font-family: Arial, sans-serif;
  flex: 1 1 calc(33.333% - 20px); /* 3 items/row on desktop */
  min-width: 280px;
  max-width: 100%;
  height: 200px;
  box-sizing: border-box;
}

/* Module chứa nội dung và viền */
.grade-module {
  border: 2px solid #2978b5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Link toàn bộ vùng */
.grade-box-link1 {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 10px 15px;
}
.grade-box-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 10px 15px;
}
.grade-onhe-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 10px 15px;
}
/* Tiêu đề bên cạnh chữ cái */
.grade-box-hdr {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  color: #2978b5;
  gap: 6px;
}

/* Tên rút gọn */
.grade-box-name {
  display: block;
}

/* Mũi tên SVG */
.grades-list-arrow {
  width: 16px;
  height: 28px;
  fill: none;
  margin-left: auto;
  flex-shrink: 0;
  cursor: pointer;
}

/* Màu điền của polygon */
.blue1-fill-svg {
  fill: #2978b5;
}

/* Phần mô tả bên dưới */
.grade-body {
  padding: 10px 15px 15px;
  /*font-size: 14px;*/
  color: #333;
  background-color: #f9f9f9;
  border-top: 1px solid #ddd;
  border-radius: 0 0 8px 8px;
  flex-grow: 1;
}

.grade-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  gap: 10px;
}

.grade-description {
  font-size: 16px;
  color: #333;
}

.subject {
  text-align: left;
  flex: 1;
}

.count {
  text-align: right;
  flex-shrink: 0;
}
    .checkbox-icon {
      width: 20px;
      height: 20px;
      border: 2px solid #4CAF50; /* Màu xanh lá */
      border-radius: 6px;
      position: relative;
      display: inline-block;
    }

    .checkbox-icon::after {
      content: '';
        position: absolute;
        left: 7px;
        top: -5px;
        width: 5px;
        height: 15px;
        border: solid #4CAF50;
        border-width: 0 4px 4px 0;
        transform: rotate(45deg);
    }
    
    .fancy-button {
      padding: 12px 30px;
      font-size: 18px;
      font-weight: bold;
      color: white;
      background: linear-gradient(135deg, #4CAF50, #2E7D32);
      border: none;
      border-radius: 12px;
      cursor: pointer;
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
    }

    .fancy-button::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.3);
      transform: skewX(-30deg);
      transition: 0.5s;
    }

    .fancy-button:hover {
      transform: scale(1.05);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }

    .fancy-button:hover::before {
      left: 100%;
    }
/* Responsive chỉnh sửa cho màn hình nhỏ */
@media (max-width: 768px) {
  .grade-list-item {
    flex: 1 1 calc(50% - 20px); /* 2 items/row on tablet */
  }
}

@media (max-width: 480px) {
  .grade-list-item {
    flex: 1 1 100%; /* 1 item/row on mobile */
  }

  .grade-box-hdr {
    font-size: 18px;
  }

  .grade-description {
    font-size: 14px;
  }
}


/* Animation */
@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

/* Responsive */
@media screen and (max-width: 768px) {

    .prev, .next {
        padding: 12px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {

    .slideshow-container {
        margin: 10px auto;
        border-radius: 8px;
    }
