:root {
  --primary: #000000;
  --secondary: #ffffff;
  --accent: #ff00ff;
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
  background-color: var(--primary);
  color: var(--secondary);
  font-family: 'Space Mono', monospace;
}

.content-wrapper {
  padding: 80px 20px 20px;
  min-height: 100vh;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

.grid-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1/1;
  transition: transform 0.3s ease;
}

.grid-item:hover {
  transform: scale(1.02);
}

.grid-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.grid-title {
  font-size: 1.2rem;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-content {
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Fullscreen Viewer */
.fullscreen-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.fullscreen-viewer.active {
  display: flex;
}

.fullscreen-content {
  width: 90%;
  height: 90%;
  position: relative;
}

.close-fullscreen {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 101;
}

.fullscreen-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fullscreen-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.fullscreen-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.fullscreen-content {
  font-size: 1.2rem;
}

/* Admin Edit Buttons */
.edit-buttons {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 101;
  display: flex;
  gap: 10px;
}

.edit-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

/* Navigation Elements */
.corner-logo {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 10;
  font-size: 2rem;
  font-weight: 700;
}

.social-links {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10;
  display: flex;
  gap: 1.5rem;
}

.social-links a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--accent);
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  display: none;
  z-index: 100;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .fullscreen-title {
    font-size: 1.8rem;
  }
  
  .fullscreen-content {
    font-size: 1rem;
    padding: 20px;
  }
}

/* Admin Styles */
.admin-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  padding: 0.8rem;
  border: 1px solid #333;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: white;
}

.upload-btn {
  padding: 0.8rem;
  background: var(--accent);
  color: white;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 1rem;
}

#media-upload {
  display: none;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.media-preview-item {
  border: 1px solid #333;
  padding: 0.5rem;
  border-radius: 4px;
}

.media-preview-item img,
.media-preview-item video {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.progress-bar {
  height: 5px;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
}

.admin-btn {
  padding: 1rem;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
}

.admin-btn.primary {
  background: var(--accent);
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
}

.loading-overlay.active {
  display: flex;
}

/* Add these styles to your CSS */
.video-thumbnail-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  pointer-events: none;
}

.grid-item:hover .video-play-icon {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.1);
  transition: all 0.2s ease;
}