/* استایل‌های responsive برای موبایل و تبلت */

/* تبلت */
@media (max-width: 900px) {
  /* منوی همبرگری */
  .hamburger-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 25px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100002;
    position: relative;
  }

  .hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  /* منوی اصلی */
  .nav-links {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 80% !important;
    height: 100vh !important;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 80px 20px 20px !important;
    transition: right 0.3s ease !important;
    z-index: 999999 !important;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3) !important;
  }

  .nav-links.active {
    right: 0 !important;
  }

  .nav-links li {
    width: 100% !important;
    margin: 0 !important;
  }

  .nav-links a {
    width: 45% !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    margin: 5px 0 !important;
    text-align: right !important;
    font-size: 1.1rem !important;
  }

  /* منوهای کشویی */
  .dropdown {
    position: relative !important;
    width: 100% !important;
  }

  .dropdown-menu {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    margin-top: 0.5rem !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
    display: none !important;
    z-index: 1000000 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }

  .dropdown.active .dropdown-menu {
    display: block !important;
  }

  /* استایل خاص برای منوی حساب کاربری */
  #user-dropdown {
    width: 0% !important;
  }

  #user-dropdown .dropdown-toggle {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 20px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    margin: 5px 0 !important;
    text-align: right !important;
    font-size: 1.1rem !important;
    color: white !important;
    text-decoration: none !important;
    transition: background 0.3s ease !important;
  }

  #user-dropdown .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
  }

  #user-dropdown .dropdown-toggle.active {
    background: rgba(255, 255, 255, 0.25) !important;
  }

  #user-dropdown .dropdown-arrow {
    transition: transform 0.3s ease !important;
  }

  #user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg) !important;
  }

  #user-dropdown .dropdown-menu {
    position: relative !important;
    display: none !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    margin-top: 0.5rem !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  }

  #user-dropdown.active .dropdown-menu {
    display: block !important;
  }

  #user-dropdown .dropdown-menu li {
    width: 100% !important;
    margin: 0 !important;
  }

  #user-dropdown .dropdown-menu a {
    width: 100% !important;
    padding: 12px 15px !important;
    margin: 2px 0 !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
    background: transparent !important;
    color: white !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: background 0.3s ease !important;
  }

  #user-dropdown .dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.2) !important;
  }

  #user-dropdown .dropdown-menu a i {
    font-size: 1rem !important;
    width: 16px !important;
    text-align: center !important;
  }

  .dropdown-menu::before {
    display: none !important;
  }

  .nested-dropdown {
    position: relative !important;
    width: 100% !important;
  }

  .nested-menu {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.1) !important;
    margin-top: 0.5rem !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
    display: none !important;
    z-index: 999999 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }

  .nested-dropdown.active .nested-menu {
    display: block !important;
  }

  .nested-menu::before {
    display: none !important;
  }

  .dropdown-menu a,
  .nested-menu a {
    padding: 10px 15px !important;
    margin: 2px 0 !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
  }

  .dropdown-menu a:hover,
  .nested-menu a:hover {
    background: rgba(255, 255, 255, 0.2) !important;
  }

  /* تنظیمات کلی */
  .navbar {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }

  .logo {
    justify-content: center !important;
    margin-bottom: 0.5rem !important;
  }

  .hero {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .hero-slider {
    max-width: 100% !important;
    min-width: 220px !important;
    height: 180px !important;
  }

  /* اطمینان از اینکه همه کانتینرها در مرکز باشند */
  .container, .page-container, main, section {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    overflow-x: hidden !important;
  }
  /* جلوگیری از overflow */
  body {
    overflow-x: hidden !important;
  }

  /* تنظیم اندازه متن */
  h1 { font-size: 1.8rem !important; }
  h2 { font-size: 1.5rem !important; }
  h3 { font-size: 1.3rem !important; }
  p { font-size: 1rem !important; }

  /* تنظیم اندازه تصاویر */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* تنظیم فرم‌ها */
  input, textarea, select {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* تنظیم جداول */
  table {
    width: 100% !important;
    overflow-x: auto !important;
  }

  /* تنظیم لیست‌ها */
  ul, ol {
    padding-right: 20px !important;
  }

  /* تنظیم لینک‌ها */
  a {
    word-wrap: break-word !important;
  }

  /* تنظیم آیکون‌ها */
  .fa, .fas, .far, .fab {
    font-size: 1em !important;
  }

  /* تنظیم SVG */
  svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Admin page */
  body.admin-page .container {
    max-width: 100% !important;
    margin: 0.8rem auto !important;
    padding: 1rem !important;
  }
  body.admin-page .search-box { flex-wrap: wrap !important; }
  body.admin-page .search-box input { min-width: 200px !important; }
  body.admin-page .search-box button { padding: 8px 12px !important; }
  body.admin-page .table-responsive { width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  body.admin-page table { min-width: 680px !important; }
  body.admin-page th, body.admin-page td { white-space: nowrap !important; }
  body.admin-page #news-form { padding: 16px !important; }
  body.admin-page #news-form input[type="text"],
  body.admin-page #news-form textarea,
  body.admin-page #news-form input[type="file"] { font-size: 14px !important; }
  body.admin-page #news-form button { min-width: 100px !important; padding: 8px 0 !important; }
}

/* موبایل */
@media (max-width: 600px) {
  /* منوی همبرگری */
  .hamburger-menu {
    width: 25px !important;
    height: 20px !important;
  }

  .hamburger-menu span {
    height: 2px !important;
  }

  /* منوی اصلی */
  .nav-links {
    width: 90% !important;
    padding: 70px 15px 15px !important;
  }

  .nav-links a {
    padding: 12px 15px !important;
    font-size: 1rem !important;
  }

  /* استایل خاص برای منوی حساب کاربری در موبایل */
  #user-dropdown .dropdown-toggle {
    padding: 12px 15px !important;
    font-size: 1rem !important;
  }

  #user-dropdown .dropdown-menu a {
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
  }

  #user-dropdown .dropdown-menu a i {
    font-size: 0.9rem !important;
    width: 14px !important;
  }

  /* تنظیمات کلی */
  .navbar {
    padding: 0.5rem 0.5rem !important;
  }

  .logo {
    font-size: 1.1rem !important;
  }

  .logo img {
    height: 36px !important;
  }

  .nav-links {
    gap: 0.3rem !important;
  }

  .nav-links a {
    font-size: 0.95rem !important;
    padding: 0.25rem 0.7rem !important;
  }

  .hero, .about, .announcements {
    padding: 1rem !important;
  }

  .about, .announcements {
    max-width: 98vw !important;
  }

  .hero-content h1 {
    font-size: 1.3rem !important;
  }

  .mission {
    font-size: 0.9rem !important;
  }

  .hero-slider {
    height: 350px !important;
  }

  .slide .slide-content {
    right: 1px !important;
    bottom: 5px !important;
  }

  .slide .slide-content h1 {
    font-size: 1.4rem !important;
  }

  /* اطمینان از اینکه همه کانتینرها در مرکز باشند */
  .container, .page-container, main, section {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 0.5rem !important;
    overflow-x: hidden !important;
  }
  .hero-section {
    height: 1900spx !important;
  }
  .hero-buttons {
    width: 220px !important;
  }
  .hero-slider {
    width:280px !important;
  }
  .welcome-section {
    height: 350px !important;
  }
  
  .features-section {
    height: 1400px !important;
    overflow: hidden !important;
  } 
  
  .stats-section {
      height: 500px;
      
  }
  
  .welcome-section {
    overflow: hidden !important;
  }

  .grade-card{
    width: 300px !important;
  }
  .news-container{
    padding-left: 50px;
  }
  .hero-news{
    max-height: 990px !important;
  }
.hero-title{
  font-size: xx-large !important;
  height: 50px !important;
}

.login-btn{
  width: 340px !important;
}

  /* جلوگیری از overflow */
  body {
    overflow-x: hidden !important;
  }

  /* تنظیم اندازه متن */
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.3rem !important; }
  h3 { font-size: 1.1rem !important; }
  p { font-size: 0.9rem !important; }

  /* تنظیم اندازه تصاویر */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* تنظیم فرم‌ها */
  input, textarea, select {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* تنظیم جداول */
  table {
    width: 100% !important;
    overflow-x: auto !important;
  }

  /* تنظیم لیست‌ها */
  ul, ol {
    padding-right: 15px !important;
  }

  /* تنظیم لینک‌ها */
  a {
    word-wrap: break-word !important;
  }

  /* تنظیم آیکون‌ها */
  .fa, .fas, .far, .fab {
    font-size: 0.9em !important;
  }

  /* تنظیم SVG */
  svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Admin page */
  body.admin-page .container { padding: 0.75rem !important; }
  body.admin-page .search-box { gap: 6px !important; }
  body.admin-page .search-box input { font-size: 13px !important; }
  body.admin-page .search-box button { font-size: 13px !important; }
  body.admin-page table { min-width: 760px !important; }
  body.admin-page #news-form { padding: 12px !important; }
  body.admin-page #news-form button { font-size: 14px !important; min-width: 96px !important; }
}
