@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700;800&display=swap");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.7;
  padding: 0;
  margin: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  color: #2d3748;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header .logo {
  font-family: "Poppins", sans-serif;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-link {
  text-decoration: none;
  color: #667eea;
  padding: 12px 20px;
  border-radius: 25px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-link i {
  font-size: 0.9em;
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.container {
  max-width: 900px;
  margin: 40px auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
h2,
h3 {
  color: #2d3748;
  font-weight: 700;
}

h1 {
  font-size: 3em;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

/*  */

h2 i {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.8em;
}

h3 {
  font-size: 1.5em;
  color: #4a5568;
  margin-bottom: 20px;
}

.topic-form textarea {
  width: 100%;
  height: 300px;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #667eea 0%, #764ba2 100%) border-box;
  resize: vertical;
  font-size: 16px;
  font-family: "Inter", sans-serif;
  margin-bottom: 20px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  line-height: 1.6;
}

.topic-form textarea:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.topic-content {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.05) 0%,
    rgba(118, 75, 162, 0.05) 100%
  );
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-left: 5px solid transparent;
  border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
  padding: 25px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
  overflow: hidden;
}

.topic-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.date-nav {
  margin: 40px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.date-nav a {
  text-decoration: none;
  color: #667eea;
  padding: 15px 25px;
  border-radius: 25px;
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #667eea 0%, #764ba2 100%) border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.date-nav a i {
  font-size: 0.9em;
}

.date-nav a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: left 0.3s ease;
  z-index: -1;
}

.date-nav a:hover::before {
  left: 0;
}

.date-nav a:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 35px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

button i {
  font-size: 0.9em;
}

button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(-1px);
}

.topic {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 30px;
  margin-bottom: 25px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.topic::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.topic:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
}

.topic h2 {
  margin-top: 0;
  font-size: 1.8em;
  border-bottom: none;
  color: #667eea;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topic h2 i {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.8em;
}

.topic p {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #4a5568;
  line-height: 1.7;
}

.message {
  padding: 20px 25px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-left: 5px solid transparent;
  border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
  margin: 25px 0;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.message::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.message p {
  margin: 0;
  color: #4a5568;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.message p i {
  color: #667eea;
  font-size: 1.1em;
}

/* Icon animations */
@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.header .logo i {
  animation: iconPulse 2s ease-in-out infinite;
}

/* Icon-specific styles */
.icon-calendar {
  color: #667eea !important;
}

.icon-edit {
  color: #764ba2 !important;
}

.icon-info {
  color: #48bb78 !important;
}

.icon-warning {
  color: #ed8936 !important;
}

/* Responsive Design */
/* Small Android phones (360px - 480px) */
@media (max-width: 480px) {
  body {
    font-size: 14px;
    background-attachment: scroll;
  }

  .header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header .logo {
    font-size: 20px;
    order: 1;
  }

  .nav-link {
    padding: 8px 16px;
    font-size: 14px;
    order: 2;
    flex: 1;
    text-align: center;
    min-width: 140px;
  }

  .container {
    margin: 10px;
    padding: 20px 16px;
    border-radius: 16px;
  }

  h1 {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 16px;
  }

  h2 {
    font-size: 1.4em;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }

  h3 {
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 16px;
  }

  .date-nav {
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
  }

  .date-nav a {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 14px;
  }

  .topic-form textarea {
    height: 200px;
    padding: 16px;
    font-size: 16px;
    border-radius: 12px;
    -webkit-appearance: none;
    resize: none;
  }

  button {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    justify-content: center;
    border-radius: 12px;
    -webkit-appearance: none;
    touch-action: manipulation;
  }

  .topic {
    padding: 20px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  .topic h2 {
    font-size: 1.3em;
    flex-direction: row;
    gap: 8px;
    text-align: left;
    border-bottom: none;
    margin-bottom: 12px;
  }

  .topic p {
    font-size: 14px;
    line-height: 1.6;
  }

  .message {
    padding: 16px;
    margin: 16px 0;
    border-radius: 12px;
    font-size: 14px;
  }

  .topic-content {
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
  }
}

/* Medium Android phones and small tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .header {
    padding: 16px 24px;
  }

  .header .logo {
    font-size: 24px;
  }

  .nav-link {
    padding: 10px 18px;
    font-size: 15px;
  }

  .container {
    margin: 16px;
    padding: 28px 24px;
    border-radius: 20px;
  }

  h1 {
    font-size: 2.2em;
  }

  h2 {
    font-size: 1.6em;
    gap: 10px;
  }

  h3 {
    font-size: 1.3em;
  }

  .date-nav {
    flex-direction: column;
    gap: 14px;
    margin: 28px 0;
  }

  .date-nav a {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
  }

  .topic-form textarea {
    height: 240px;
    padding: 18px;
    font-size: 16px;
  }

  button {
    width: 100%;
    padding: 14px 28px;
    justify-content: center;
  }

  .topic {
    padding: 24px 20px;
    margin-bottom: 20px;
  }

  .topic h2 {
    font-size: 1.5em;
  }
}

/* Large tablets and landscape phones (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .header {
    padding: 18px 32px;
  }

  .header .logo {
    font-size: 26px;
  }

  .container {
    margin: 24px;
    padding: 32px 28px;
  }

  .date-nav {
    margin: 32px 0;
  }

  .topic-form textarea {
    height: 280px;
  }
}

/* Touch-specific improvements */
@media (pointer: coarse) {
  button,
  .nav-link,
  .date-nav a {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }

  .topic-form textarea {
    -webkit-user-select: text;
    user-select: text;
  }

  /* Improved touch targets */
  .nav-link,
  .date-nav a {
    position: relative;
  }

  .nav-link::after,
  .date-nav a::after {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    z-index: -1;
  }
}

/* High DPI displays (common on Android) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .header,
  .container,
  .topic,
  .message {
    border-width: 0.5px;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  .header {
    padding: 10px 20px;
  }

  .container {
    margin: 16px auto;
    padding: 24px;
  }

  .topic-form textarea {
    height: 180px;
  }

  h1 {
    font-size: 2em;
    margin-bottom: 16px;
  }

  h2 {
    font-size: 1.6em;
    margin-bottom: 20px;
  }
}

/* Android Chrome specific fixes */
@supports (-webkit-touch-callout: none) {
  .topic-form textarea {
    -webkit-appearance: none;
    border-radius: 12px;
  }

  button {
    -webkit-appearance: none;
    border-radius: 12px;
  }
}

/* Prevent zoom on input focus (Android) */
@media (max-width: 768px) {
  .topic-form textarea {
    font-size: 16px !important;
  }
}

/* Scroll animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.topic {
  animation: fadeInScale 0.6s ease-out;
}
