/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
}

/* Font Customizations */
h1, h2, h3, h4 {
  font-family: 'Orbitron', sans-serif;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
code {
border: 1px dotted grey;
  font-family: 'Orbitron', sans-serif;
  color: #ffffff;
  background-color: #4e4e4e;
}

/* Logo Styles */
.fg-logo {
  width: 50px;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fg-logo span {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: #38bdf8;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 5px #38bdf8, 0 0 10px #38bdf8;
}

.fg-logo::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  animation: neon-pulse 3s infinite ease-in-out;
  z-index: 1;
}

@keyframes neon-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.5); }
  50% { box-shadow: 0 0 30px rgba(56, 189, 248, 0.8); }
}

/* Card Styles */
.card {
  background: rgba(45, 55, 72, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

.card-header {
  cursor: pointer;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.card-content.open {
  max-height: none;
  padding: 1rem;
}

/* Post Content Styles */
.post-content {
  color: #e2e8f0;
  font-size: 0.875rem;
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content h1, .post-content h2, .post-content h3, .post-content h4, .post-content h5, .post-content h6 {
  font-family: 'Orbitron', sans-serif;
  color: #38bdf8;
  margin: 1.5rem 0 1rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content a {
  color: #38bdf8;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.post-content a:hover {
  color: #0284c7;
}

/* Fade-in Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Navigation Styles */
nav {
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(10px);
}

nav a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #38bdf8;
text-decoration: underline;
}

/* Post Styles */
.post-image {
  display: block;
  margin-bottom: 1rem;
  object-fit: cover;
  width: 60%;
  border-radius: 8px;
}

.post-single .post-image {
  max-width: 300px;
  max-height: 200px;
  margin-left: auto;
  margin-right: auto;
}

.post-image[src=""], .post-image:not([src]) {
  background-color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.875rem;
  text-align: center;
  border-radius: 8px;
}

/* Comment Styles */
.comment {
  padding: 1rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  margin-bottom: 1rem;
}

.comment:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Links Container */
.links-container {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(45, 55, 72, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.links-container ul {
  padding-left: 1.5rem;
}

.links-container li {
  margin-bottom: 0.5rem;
  list-style-type: disc;
}

/* Link Entry for Form */
.link-entry {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #2d3748;
  border-radius: 6px;
}

.link-entry input {
  width: 100%;
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

input,
textarea,
select {
  padding: 0.75rem;
  border: 1px solid #4b5563;
  border-radius: 6px;
  background: #2d3748;
  color: #e2e8f0;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

select {
  appearance: none;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path fill="%23e2e8f0" d="M7 10l5 5 5-5z"/></svg>') no-repeat right 0.75rem center/12px 12px;
}

/* Search Styles */
.search-container {
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.search-container.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.search-input {
  background: #2d3748;
  border-color: #4b5563;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-button {
  background-color: #38bdf8;
}

.search-button:hover {
  background-color: #0284c7;
}

/* Table Styles for manage_categories.php */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border: 1px solid #4b5563;
  padding: 0.75rem;
  text-align: left;
}

th {
  background: #2d3748;
  color: #38bdf8;
  font-weight: 600;
}

/* Gallery Styles */
.gallery-container {
  margin-top: 2rem;
  padding: 1.5rem;
}

.gallery-single {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.gallery-image-wrapper {
  width: 300px;
  height: 200px;
  position: relative;
  z-index: 1;
}

.gallery-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  visibility: visible;
}

.gallery-image:hover {
  transform: scale(1.05);
}

.gallery-image[src=""], .gallery-image:not([src]) {
  background-color: #4b5563;
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.875rem;
  text-align: center;
  border-radius: 8px;
}

.gallery-prev, .gallery-next {
  background-color: #2d3748;
  color: #38bdf8;
  border: none;
  padding: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  width: 32px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  pointer-events: auto;
  z-index: 200;
  position: relative;
}

.gallery-prev:hover, .gallery-next:hover {
  background-color: #38bdf8;
  color: #ffffff;
  transform: scale(1.1);
}

.gallery-arrow-placeholder {
  width: 32px;
  height: 32px;
}

/* Footer Styles */
.footer-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-brand h3 {
  font-family: 'Orbitron', sans-serif;
}

.footer-stats p,
.footer-brand p,
.footer-links a {
  font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .fg-logo {
    width: 20px;
    height: 20px;
  }

  .fg-logo span {
    font-size: 1.2rem;
  }

  .card {
    margin: 0 1rem;
  }

  .post-preview {
    flex-direction: column;
  }

  .post-preview .post-image {
    width: 100%;
    height: auto;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .gallery-single {
    max-width: 100%;
    gap: 0.5rem;
  }

  .gallery-image-wrapper {
    width: 100%;
    height: 250px;
  }

  .gallery-image {
    width: 100%;
    height: 250px;
  }

  .gallery-image[src=""], .gallery-image:not([src]) {
    width: 100%;
    height: 250px;
  }

  .gallery-prev, .gallery-next {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .gallery-arrow-placeholder {
    width: 28px;
    height: 28px;
  }
}