:root {
  --primary: #fff;
  --secondary: rgba(255, 255, 255, 0.7);
  --accent: #0070f3;
  --background: #000;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Karla", sans-serif;
  background-color: var(--background);
  color: var(--primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Grid Background */
.grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: -1px -1px;
  background-color: rgba(255, 255, 255, 0.02);
  z-index: -1;
}

/* Gradient Overlay */
.gradient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(0, 112, 243, 0.1),
    transparent 70%
  );
  z-index: -1;
  pointer-events: none;
}

nav {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

nav h3 {
  font-weight: 600;
  background: linear-gradient(45deg, var(--accent), #00c6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.5rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7rem 1rem 2rem;
}

#new-post {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 2rem;
  margin-bottom: 2rem;
  display: grid;
  gap: 2rem;
  transition: var(--transition);
}

#new-post:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 112, 243, 0.1);
}

label {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

input,
textarea {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem;
  color: var(--primary);
  font-family: inherit;
  transition: var(--transition);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  font-family: Karla;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: auto;
  justify-self: start;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.3);
}

#blog-list {
  display: grid;
  gap: 1.5rem;
}

.form-group {
  position: relative;
  display: grid;
  gap: 0.5rem;
}

.error-message {
  color: #ff4a4a;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  position: absolute;
  bottom: -1.5rem;
}

.error-message svg {
  width: 14px;
  height: 14px;
}

.error-message.show {
  opacity: 1;
  transform: translateY(0);
}

input.error,
textarea.error {
  border-color: #ff4a4a;
  animation: shake 0.5s ease;
}

/* Alert Container for Form Submission */
.alert-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}

.alert {
  background: rgba(255, 74, 74, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 74, 74, 0.2);
  padding: 1rem;
  border-radius: 8px;
  color: #ff4a4a;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease forwards;
  transform-origin: top right;
}

.post {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  transition: var(--transition);
}

.post:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 112, 243, 0.1);
}

.post h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.post p {
  color: var(--secondary);
  font-size: 0.95rem;
}

.post-meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--secondary);
}

footer {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  margin-top: auto;
  width: 100%;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-text {
  color: var(--secondary);
  font-size: 0.9rem;
}

.portfolio {
  text-decoration: none;
  color: salmon;
  transition: color 0.3s ease-in-out;
}

.portfolio:hover {
  color: var(--primary);
}

.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-link {
  color: var(--secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.social-link:hover {
  color: var(--primary);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.1);
}

.social-link i {
  font-size: 1.25rem;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  flex: 1;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 6rem 1rem 2rem;
  }

  nav {
    padding: 1rem;
  }

  #new-post {
    padding: 1.5rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .social-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  nav h3 {
    font-size: 1.25rem;
  }

  .post {
    padding: 1rem;
  }

  button {
    width: 100%;
  }

  footer {
    padding: 1rem;
  }

  .social-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--secondary);
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 3px solid var(--background);
  transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.05);
}

/* Custom Scrollbar for Textarea */
textarea::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

textarea::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  border: 2px solid var(--background);
}

textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}
