/* --------------------------------------------------
   Reset & Global Styles
-------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f8f9fa; /* gray-100 */
  color: #343a40;            /* gray-800 */
  line-height: 1.5;
  min-height: 100vh;
}

/* --------------------------------------------------
   Layout Containers
-------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;             /* spacing-md */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  text-align: center;
  margin-bottom: 32px;       /* spacing-xl */
  padding: 32px 0;           /* spacing-xl */
}

header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #2A5DB3;            /* primary-dark */
  margin-bottom: 8px;        /* spacing-sm */
}

header p {
  color: #6c757d;            /* gray-600 */
  font-size: 1.1rem;
}

main {
  flex: 1;
}

/* --------------------------------------------------
   Converter / Output Section
-------------------------------------------------- */
.converter-container {
  background-color: #ffffff !important; /* light-color */
  border-radius: 12px;       /* border-radius-lg */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* shadow-md */
  padding: 32px;             /* spacing-xl */
  margin-bottom: 32px;       /* spacing-xl */
}

.input-section,
.output-section {
  margin-bottom: 24px;       /* spacing-lg */
}

label {
  display: block;
  margin-bottom: 8px;        /* spacing-sm */
  font-weight: 500;
  color: #495057;            /* gray-700 */
}

textarea {
  width: 100%;
  height: 120px;
  padding: 16px;             /* spacing-md */
  border: 1px solid #dee2e6 !important; /* gray-300 */
  border-radius: 8px;        /* border-radius-md */
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s ease; /* transition-speed */
}

textarea:focus {
  outline: none;
  border-color: #3B7BE5 !important;     /* primary-color */
  box-shadow: 0 0 0 3px rgba(59, 123, 229, 0.2);
}

textarea::placeholder {
  color: #adb5bd !important;            /* gray-500 */
}

#output-text {
  background-color: #f8f9fa; /* gray-100 */
}

.action-buttons {
  display: flex;
  gap: 16px;                 /* spacing-md */
  margin-top: 16px;          /* spacing-md */
}

/* --------------------------------------------------
   Footer & Toast Notifications
-------------------------------------------------- */
footer {
  text-align: center;
  padding: 24px 0;           /* spacing-lg */
  color: #6c757d;            /* gray-600 */
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #343a40 !important; /* gray-800 */
  color: white !important;
  padding: 12px 24px;
  border-radius: 8px;        /* border-radius-md */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* shadow-md */
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --------------------------------------------------
   Button Styles
-------------------------------------------------- */
.buttons-container {
  margin: 32px 0;            /* spacing-xl */
}

.buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;                 /* spacing-md */
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem !important;
  border: none !important;
  border-radius: 8px !important;        /* border-radius-md */
  padding: 16px !important;             /* spacing-md */
  font-weight: 500 !important;
  transition: all 0.2s ease; /* transition-speed */
}

.case-btn {
  background-color: #e9ecef !important; /* gray-200 */
  color: #343a40 !important;            /* gray-800 */
  border: 1px solid #dee2e6; /* gray-300 */
}

.case-btn:hover {
  background-color: #dee2e6 !important; /* gray-300 */
  transform: translateY(-2px);
}

.case-btn:active {
  transform: translateY(0);
}

.case-btn.active {
  background-color: #5C95F7 !important; /* primary-light */
  color: white !important;
  border-color: #3B7BE5 !important;     /* primary-color */
}

#copy-btn,
#clear-btn {
  padding: 16px 24px;        /* spacing-md spacing-lg */
  min-width: 100px;
}

#copy-btn {
  background-color: #3B7BE5 !important; /* primary-color */
  color: white;
}

#copy-btn:hover {
  background-color: #2A5DB3; /* primary-dark */
}

#clear-btn {
  background-color: #e9ecef !important; /* gray-200 */
  color: #495057 !important;            /* gray-700 */
}

#clear-btn:hover {
  background-color: #dee2e6 !important; /* gray-300 */
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 123, 229, 0.3);
}

/* Subtle ripple animation */
.case-btn,
#copy-btn,
#clear-btn {
  position: relative;
  overflow: hidden;
}

.case-btn::after,
#copy-btn::after,
#clear-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5) !important;
  opacity: 0;
  border-radius: 100%;
  transform: scale(1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.case-btn:active::after,
#copy-btn:active::after,
#clear-btn:active::after {
  opacity: 0.3;
  transform: scale(100) translate(-50%, -50%);
  transition: all 0.6s, opacity 0.3s;
}

/* --------------------------------------------------
   Responsive Styles
-------------------------------------------------- */
/* Tablet (≤1024px) */
@media screen and (max-width: 1024px) {
  .buttons-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  header h1 {
    font-size: 2.2rem;
  }

  header p {
    font-size: 1rem;
  }

  .converter-container {
    padding: 24px; /* spacing-lg */
  }
}

/* Mobile (≤767px) */
@media screen and (max-width: 767px) {
  .buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  header {
    margin-bottom: 24px;       /* spacing-lg */
    padding: 24px 0;           /* spacing-lg */
  }

  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 0.9rem;
  }

  .converter-container {
    padding: 16px;             /* spacing-md */
  }

  textarea {
    height: 100px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;                  /* spacing-sm */
  }

  #copy-btn,
  #clear-btn {
    width: 100%;
  }
}

/* Small Mobile (≤480px) */
@media screen and (max-width: 480px) {
  .buttons-grid {
    grid-template-columns: 1fr;
    gap: 8px;                  /* spacing-sm */
  }

  header h1 {
    font-size: 1.5rem;
  }

  label {
    font-size: 0.9rem;
  }

  .buttons-container {
    margin: 24px 0;            /* spacing-lg */
  }

  .case-btn {
    padding: 8px 16px;         /* spacing-sm spacing-md */
  }

  .converter-container {
    border-radius: 8px;        /* border-radius-md */
  }
}
