@font-face {
  font-family: "Samim";
  src: url("../fonts/Samim.ttf") format("truetype");
}

@font-face {
  font-family: "Samim-Bold";
  src: url("../fonts/Samim-Bold.ttf") format("truetype");
}

/* General Styles */
body {
  font-family: "Samim", sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.5s, color 0.5s;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Samim-Bold", sans-serif;
  font-weight: 700;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px;
}

/* Light Theme */
body.light-theme {
  background-color: #e0e5ec;
  color: #3d4a5d;
}

/* Dark Theme */
body.dark-theme {
  background-color: #1a1a1a;
  color: #e0e5ec;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 15px;
  margin: 20px;
  margin-bottom: 40px;
  transition: all 0.3s ease;
  position: relative; /* Add position relative for mobile menu positioning */
  z-index: 1001; /* Ensure header is on top */
}

body.dark-theme header {
  background: rgba(40, 40, 40, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

header nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

header nav ul li {
  display: inline-block;
  margin-right: 25px;
}

header nav a {
  text-decoration: none;
  color: #3d4a5d;
  font-weight: 600;
  font-size: 1.2em;
  transition: color 0.3s ease, transform 0.3s ease;
}

header nav a:hover {
  color: #007bff;
  transform: translateY(-3px);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  cursor: pointer;
}

.hamburger i {
  font-size: 1.5rem;
}

body.dark-theme header nav a {
  color: #e0e5ec;
}

body.dark-theme header nav a:hover {
  color: #17a2b8;
}

/* Theme-switcher */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.8em;
  transition: transform 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.2);
}

body.dark-theme #theme-toggle {
  color: #fff;
}

/* Main Content */
main {
  padding: 30px;
  margin-bottom: 40px;
}

#introduction {
  display: flex;
  align-items: center;
  gap: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 50px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#introduction:hover {
  transform: translateY(-10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#introduction h1 {
  font-family: "Samim-Bold", sans-serif;
}

@media (max-width: 768px) {
  #introduction {
    flex-direction: column;
    text-align: center;
  }

  #introduction h1 {
    font-size: 1.8rem;
  }

  body:not(.admin-panel) header nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 0 0 15px 15px;
    padding: 1rem 0;
    z-index: 1000;
  }

  body:not(.admin-panel) header nav ul.show {
    display: flex;
  }

  body.dark-theme:not(.admin-panel) header nav ul {
    background: rgba(40, 40, 40, 0.9);
  }

  body:not(.admin-panel) header nav ul li {
    margin: 0.5rem 0;
    text-align: center;
  }

  .hamburger {
    display: block;
  }

  [lang="fa"] header nav ul li {
    margin-left: 0;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 25px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: 20px;
  border-radius: 15px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-theme footer {
  background: rgba(40, 40, 40, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* RTL Styles */
[lang="fa"] {
  direction: rtl;
}

[lang="fa"] header nav ul li {
  margin-right: 0;
  margin-left: 25px;
  padding: 0.5em;
}

[lang="fa"] #introduction {
  text-align: right;
}

[lang="fa"] .introduction-text h1,
[lang="fa"] .introduction-text h2,
[lang="fa"] .introduction-text p {
  text-align: right;
}

[lang="fa"] .blog-post {
  text-align: right;
}

[lang="fa"] .post-full {
  text-align: right;
}

/* Blog list styles */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.blog-post {
  border: none;
  padding: 25px;
  border-radius: 15px;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.blog-post:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.blog-post h2 a {
  text-decoration: none;
  color: #3d4a5d;
}

body.dark-theme .blog-post h2 a {
  color: #e0e5ec;
}

.post-meta {
  font-size: 0.9em;
  color: #5a6a7d;
  margin-bottom: 12px;
}

body.dark-theme .post-meta {
  color: #a0b0c0;
}

.post-summary {
  margin-bottom: 18px;
}

.read-more {
  display: inline-block;
  padding: 10px 18px;
  background-image: linear-gradient(45deg, #007bff, #17a2b8);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.read-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

/* Single post styles */
.post-full {
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-theme .post-full {
  background-color: rgba(40, 40, 40, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.post-content {
  line-height: 1.8;
  font-size: 1.15em;
}

/* Login Form Styles */
.login-container {
  width: 350px;
  margin: 120px auto;
  padding: 30px;
  border: none;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
  text-align: center;
  margin-bottom: 25px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.login-container button {
  width: 100%;
  padding: 12px;
  background-image: linear-gradient(45deg, #007bff, #17a2b8);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.login-container button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

/* Admin Panel Styles */

}

.admin-panel header {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 0;
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.admin-panel header h1 {
  font-size: 1.6em;
  color: #3d4a5d;
}

.admin-panel nav ul li a {
  color: #3d4a5d;
}

.admin-panel main {
  padding: 40px;
}

.admin-panel table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  background-color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.admin-panel th,
.admin-panel td {
  border: 1px solid #e0e5ec;
  padding: 15px;
  text-align: left;
}

.admin-panel th {
  background-color: #f8f9fa;
}

.admin-panel .btn {
  display: inline-block;
  padding: 12px 20px;
  background-image: linear-gradient(45deg, #007bff, #17a2b8);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  margin-top: 25px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.admin-panel .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

.admin-panel .action-links a {
  margin-right: 12px;
  color: #007bff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.admin-panel .action-links a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.post-summary a {
    color: #007bff;
    text-decoration: none;
}

.post-summary a:hover {
    text-decoration: underline;
}

#load-more {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#load-more:hover {
    background-color: #0056b3;
}