/* Base - Same as main site */
body {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.4s, color 0.4s;
  overflow-x: hidden;
}

:root {
  --bg: #f9f9f9;
  --text: #111;
  --nav-bg: #ffffffdd;
  --accent: #00bcd4;
  --neon: #00fff0;
  --border: #e1e8ed;
  --hover-bg: #f5f8fa;
  --modal-overlay: rgba(0, 0, 0, 0.8);
}

body.dark {
  --bg: #0d1117;
  --text: #f5f5f5;
  --nav-bg: #1a1f24dd;
  --accent: #00eaff;
  --neon: #00ffff;
  --border: #2d3741;
  --hover-bg: #1e2328;
  --modal-overlay: rgba(0, 0, 0, 0.9);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  padding: 8px 20px;
  z-index: 900;
  transition: top 0.3s;
  box-shadow: 0 2px 10px #0003;
  backdrop-filter: blur(10px);
}

.navbar.hide {
  top: -80px;
}

.logo-section {
  display: flex;
  align-items: center;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-right: 10px;
}

.site-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* Fixed Buttons */
.fixed-buttons {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1001;
}

.fixed-buttons button {
  background: var(--nav-bg);
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 0 15px var(--neon);
  transition: background 0.3s, color 0.3s, transform 0.2s;
  backdrop-filter: blur(10px);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fixed-buttons button:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 70px;
  right: 20px;
  width: 220px;
  background-color: var(--nav-bg);
  box-shadow: 0 4px 20px #0005;
  border-radius: 8px;
  z-index: 1000;
  animation: slideDown 0.3s ease forwards;
  backdrop-filter: blur(10px);
}

.dropdown-menu a {
  color: var(--text);
  text-decoration: none;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display: block;
  transition: background 0.3s, color 0.3s;
}

.dropdown-menu a:hover {
  background: var(--accent);
  color: #fff;
}

@keyframes slideDown {
  0% {opacity: 0; transform: translateY(-20px);}
  100% {opacity: 1; transform: translateY(0);}
}

/* Diary Container */
.diary-container {
  max-width: 1200px;
  margin: 80px auto 20px;
  padding: 0 20px;
}

.diary-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 10px;
  color: var(--text);
}

.diary-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 40px;
  opacity: 0.8;
}

/* Stories Grid */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

/* Story Card */
.story-card {
  background: var(--nav-bg);
  border-radius: 16px;
  padding: 25px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: fit-content;
}

.story-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.story-header {
  margin-bottom: 15px;
}

.story-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.story-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.7;
}

.story-content {
  flex: 1;
  margin-bottom: 20px;
}

.story-preview {
  color: var(--text);
  line-height: 1.6;
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.read-full-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.read-full-btn:hover {
  background: var(--neon);
  transform: scale(1.05);
}

/* Load More Button */
.load-more-container {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.load-more-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.load-more-btn:hover {
  background: var(--neon);
  transform: scale(1.05);
}

.load-more-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Story Modal */
.story-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.story-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--nav-bg);
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text);
  cursor: pointer;
  z-index: 2001;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.close-modal:hover {
  background: var(--hover-bg);
}

.modal-header {
  padding: 30px 40px 20px 40px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  margin: 0 0 10px 0;
  color: var(--text);
  line-height: 1.3;
}

.modal-meta {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.7;
}

.modal-body {
  padding: 20px 40px 30px 40px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(90vh - 150px);
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--neon);
}

#modal-content {
  color: var(--text);
  line-height: 1.8;
  font-size: 1.1rem;
}

#modal-content p {
  margin-bottom: 1.5em;
}

#modal-content h1, #modal-content h2, #modal-content h3 {
  font-family: 'Orbitron', sans-serif;
  margin: 1.5em 0 0.8em 0;
  color: var(--accent);
}

#modal-content h1 {
  font-size: 1.8rem;
}

#modal-content h2 {
  font-size: 1.5rem;
}

#modal-content h3 {
  font-size: 1.3rem;
}

/* Animations */
@keyframes fadeIn {
  0% {opacity: 0;}
  100% {opacity: 1;}
}

@keyframes slideUp {
  0% {opacity: 0; transform: translateY(30px);}
  100% {opacity: 1; transform: translateY(0);}
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.slide-up {
  animation: slideUp 0.5s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
  .diary-container {
    margin: 70px auto 10px;
    padding: 0 15px;
  }
  
  .diary-title {
    font-size: 2rem;
  }
  
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .story-card {
    padding: 20px;
  }
  
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 25px 25px 15px 25px;
  }
  
  .modal-header h2 {
    font-size: 1.6rem;
  }
  
  .modal-body {
    padding: 15px 25px 25px 25px;
    max-height: calc(95vh - 120px);
  }
  
  .close-modal {
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
  }
}