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

:root {
  /* Light Theme Colors */
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #f59e0b;
  --background-start: #4a5d8a;
  --background-end: #5a4d7a;
  --surface-color: rgba(255, 255, 255, 0.25);
  --surface-border: rgba(255, 255, 255, 0.18);
  --text-primary: #1f2937;
  --text-light: rgba(255, 255, 255, 0.9);
  --title-color: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --blur-amount: 20px;
}

[data-theme="dark"] {
  /* Dark Theme Colors */
  --background-start: #1e1e2e;
  --background-end: #1a1a2a;
  --surface-color: rgba(255, 255, 255, 0.1);
  --surface-border: rgba(255, 255, 255, 0.2);
  --text-primary: #f9fafb;
  --title-color: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(
    135deg,
    var(--background-start) 0%,
    var(--background-end) 100%
  );
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated Background */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.background-animation::before,
.background-animation::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float 15s ease-in-out infinite;
}

.background-animation::before {
  width: 300px;
  height: 300px;
  background: var(--primary-color);
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.background-animation::after {
  width: 200px;
  height: 200px;
  background: var(--secondary-color);
  top: 60%;
  right: 10%;
  animation-delay: 7s;
}

.theme-toggle i {
  position: absolute;
  transition: all 0.3s ease;
}

.theme-toggle .fa-sun {
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .fa-moon {
  opacity: 0;
  transform: rotate(-180deg);
}

[data-theme="dark"] .theme-toggle .fa-sun {
  opacity: 1;
  transform: rotate(0deg);
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 3rem;
  padding: 1rem 0;
  color: var(--text-light);
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  animation: slideInDown 1s ease-out;
  position: relative;
}

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

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.help-btn,
.theme-toggle {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--surface-color);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--surface-border);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px var(--shadow-color);
}

.help-btn:hover,
.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--primary-color);
}

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

.modal-content {
  background: var(--surface-color);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--surface-border);
  margin: 5% auto;
  padding: 2rem;
  border-radius: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px var(--shadow-color);
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: var(--accent-color);
}

.modal-content h2 {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.5rem;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.shortcut-item span {
  color: var(--text-light);
  font-size: 1rem;
}

kbd {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-light);
  box-shadow: 0 2px 4px var(--shadow-color);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.logo-icon {
  font-size: 3rem;
}

.logo-text {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--title-color);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.highlight {
  background: linear-gradient(45deg, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Main Content */
.main-content {
  animation: slideInUp 1s ease-out 0.3s both;
}

/* Excuse Card */
.excuse-card {
  background: var(--surface-color);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 60px var(--shadow-color);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.excuse-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 70px var(--shadow-color);
}

.excuse-content {
  text-align: center;
  margin-bottom: 1.5rem;
}

.excuse-text {
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--text-light);
  font-weight: 400;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Excuse Actions */
.excuse-actions {
  display: none;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.excuse-actions.show {
  display: flex;   
  opacity: 1;
  transform: translateY(0);
}

.action-btn {
  width: 45px;
  height: 45px;
  border: none;

  border-radius: 50%;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.action-btn:hover {
  transform: scale(1.2);
  background: var(--primary-color);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Generate Section */
.generate-section {
  text-align: center;
}

.generate-btn {
  position: relative;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(45deg, #e55555, #d4a574);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(229, 85, 85, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.generate-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 40px rgba(229, 85, 85, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(10deg);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .logo-text {
    font-size: 2rem;
  }

  .logo-icon {
    font-size: 2.5rem;
  }

  .excuse-card {
    padding: 1.5rem;
  }

  .excuse-text {
    font-size: 1.1rem;
  }

  .generate-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
  }

  .help-btn,
  .theme-toggle {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .modal-content {
    margin: 10% auto;
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
  }

  .background-animation::before,
  .background-animation::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .logo {
    flex-direction: column;
    gap: 0.5rem;
  }

  .logo-text {
    font-size: 1.8rem;
  }

  .excuse-card {
    padding: 1rem;
  }

  .excuse-text {
    font-size: 1rem;
  }

  .btn-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .action-btn {
    width: 40px;
    height: 40px;
  }

  .help-btn,
  .theme-toggle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .modal-content {
    margin: 25% auto;
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
  }

  .modal-content h2 {
    font-size: 1.2rem;
  }

  .shortcut-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Focus styles for accessibility */
button:focus-visible,
.action-btn:focus-visible,
.close:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Modal focus trap styles */
.modal[aria-modal="true"] {
  position: fixed;
  z-index: 2000;
}

.modal[aria-modal="true"] .modal-content {
  position: relative;
}

/* Improve close button accessibility */
.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.3s ease;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.close:hover,
.close:focus-visible {
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.1);
}

/* Toast Container to Show Message */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background-color: #333;
  color: #fff;
  padding: 8px 16px;
  margin-bottom: 10px;
  border-radius: 5px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  font-family: sans-serif;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
