/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */

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

:root {
  --bg-0: #030a08;
  --bg-1: #072017;
  --bg-2: #0d1512;
  --text-primary: #edf2ee;
  --text-muted: #b7c4bd;
  --text-dim: #7f8f87;
  --surface-0: rgba(23, 32, 30, 0.76);
  --surface-1: rgba(45, 55, 53, 0.78);
  --surface-border: rgba(145, 171, 157, 0.28);
  --field-bg: rgba(58, 63, 66, 0.74);
  --field-border: rgba(142, 156, 149, 0.36);
  --accent: #97d9af;
  --accent-strong: #87ca9f;
  --accent-text: #092417;
  --danger: #ff8686;
  --success: #8ce4b2;
}

html {
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  font-family: 'Google Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: 'Google Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(1200px 700px at -15% -10%, #10533f 0%, transparent 56%),
    radial-gradient(950px 620px at 110% 18%, #0a3a2d 0%, transparent 58%),
    linear-gradient(140deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-2) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}

/* Container & Layout */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 28px);
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  box-sizing: border-box;
}

.header {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: clamp(24px, 4vw, 40px);
  padding: clamp(18px, 2.8vw, 30px) 0;
}

.header h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.75rem);
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  line-height: 0.95;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  letter-spacing: 2px;
}

.subtitle {
  font-size: clamp(1rem, 1.1vw + 0.7rem, 1.45rem);
  font-weight: 400;
  color: var(--text-muted);
  opacity: 1;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.shortener-card {
  background: linear-gradient(145deg, var(--surface-0), rgba(20, 27, 26, 0.84));
  border-radius: clamp(20px, 4.5vw, 34px);
  padding: clamp(20px, 4vw, 40px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border: 1px solid var(--surface-border);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Form Styles */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  width: 100%;
}

/* Hide form when results are visible */
.shortener-card .form {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.shortener-card:has(.result-container:not(.hidden)) .form {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

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

.form-label {
  font-weight: 600;
  color: #8fb4a0;
  font-size: 0.96rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-input {
  padding: 14px 18px;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
  color: #dce6e2;
  background: var(--field-bg);
}

.form-input:focus {
  outline: none;
  border-color: rgba(158, 217, 181, 0.65);
  box-shadow: 0 0 0 3px rgba(122, 196, 157, 0.18);
}

.form-input::placeholder {
  color: #8a9591;
}

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 20px;
  display: block;
}

.form-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  display: block;
  margin-top: -5px;
}

.expiration-info {
  color: #8fb4a0;
  font-size: 0.85rem;
  display: block;
  margin-top: 8px;
  font-weight: 500;
}

/* Button Styles */
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-text);
  border: 1px solid rgba(163, 220, 187, 0.62);
  border-radius: 999px;
  min-height: 58px;
  min-width: 150px;
  position: relative;
  box-shadow:
    0 16px 36px rgba(94, 185, 135, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 20px 42px rgba(94, 185, 135, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(33, 44, 42, 0.86);
  color: #cde1d8;
  border: 1px solid rgba(144, 170, 156, 0.35);
  padding: 12px 20px;
  min-width: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-secondary:hover {
  background: rgba(42, 54, 51, 0.92);
  border-color: rgba(159, 217, 182, 0.54);
}

.btn-text {
  display: inline;
}

.btn-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Result Container */
.result-container {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  width: 100%;
  position: relative;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-btn {
  background: rgba(32, 44, 42, 0.75);
  border: 1px solid rgba(140, 165, 152, 0.35);
  color: #d4e1db;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.back-btn:hover {
  background: rgba(40, 53, 50, 0.88);
  border-color: rgba(160, 215, 183, 0.55);
  transform: translateX(-4px);
}

.back-btn:active {
  transform: translateX(-2px);
}

.result-container:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.result-container.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideIn 0.3s ease-out;
}

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

.result-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-label {
  font-weight: 600;
  color: #94b7a4;
  font-size: 0.95rem;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-display {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.result-display .result-input {
  min-width: 250px;
  flex: 1 1 auto;
}

.result-display .btn-secondary {
  white-space: nowrap;
  flex-shrink: 0;
    background: rgba(31, 43, 40, 0.9);
    color: #d2e3db;
    border: 1px solid rgba(145, 170, 157, 0.35);
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.btn-secondary:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.result-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(143, 160, 152, 0.36);
  border-radius: 14px;
  font-size: 1rem;
  background: rgba(51, 58, 60, 0.78);
  font-family: 'Google Sans Code', 'Courier New', monospace;
  color: #dce6e1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-input:focus {
  outline: none;
  border-color: rgba(158, 217, 181, 0.62);
}

.copy-feedback {
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 600;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Message Container */
.message-container {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
}

.message {
  color: var(--success);
  word-wrap: break-word;
  word-break: break-word;
}

.message-container.error .message {
  color: var(--danger);
  background: #ffffff00;
}

.message-container.success .message {
  color: var(--success);
  background: #ffffff00;
}

/* Info Section */
.info-section {
  color: var(--text-primary);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.info-section h2 {
  font-size: 2rem;
  margin-bottom: 30px;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.info-card {
  background: rgba(31, 42, 40, 0.52);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(144, 170, 157, 0.26);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
}

.info-card:hover {
  background: rgba(40, 52, 50, 0.68);
  transform: translateY(-5px);
  border-color: rgba(158, 216, 182, 0.45);
}

.info-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: block;
}

.info-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.info-card p {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Footer */
.footer {
  text-align: center;
  color: #94a59d;
  padding: 30px 20px 20px;
  margin-top: 40px;
  font-size: 0.95rem;
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    text-align: left;
  }

  .header h1 {
    font-size: clamp(2rem, 9vw, 3.4rem);
  }

  .shortener-card {
    padding: clamp(18px, 5.2vw, 28px);
    max-width: 100%;
    border-radius: 24px;
  }

  .form-group {
    gap: 6px;
  }

  .form-input {
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 999px;
  }

  .form-label {
    font-size: 0.95rem;
  }

  .form-hint {
    font-size: 0.8rem;
  }

  .btn-primary {
    width: 100%;
    min-width: unset;
    min-height: 56px;
    padding: 14px 20px;
  }

  .result-display {
    flex-direction: column;
    gap: 12px;
  }

  .result-display .result-input {
    min-width: unset;
    width: 100%;
  }

  .result-display .btn-secondary {
    width: 100%;
    min-width: unset;
  }

  .result-input {
    padding: 12px 14px;
    font-size: 16px;
    width: 100%;
  }

  .result-label {
    font-size: 0.9rem;
  }

  .result-group {
    gap: 6px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    font-size: 0.95rem;
    padding: 12px 24px;
  }

  .subtitle {
    font-size: 1.05rem;
    max-width: 28ch;
  }

  .info-section h2 {
    font-size: 1.5rem;
  }

  .expiration-info {
    font-size: 0.8rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .header {
    text-align: left;
  }

  .header h1 {
    font-size: clamp(1.9rem, 13vw, 2.8rem);
    margin-bottom: 8px;
  }

  .header {
    margin-bottom: 20px;
    padding: 15px 0;
  }

  .container {
    padding: clamp(12px, 3.8vw, 16px);
  }

  .shortener-card {
    padding: clamp(14px, 4.4vw, 18px);
    margin: 0;
    border-radius: 20px;
  }

  .form-group {
    gap: 6px;
    margin-bottom: 14px;
  }

  .form-label {
    font-size: 0.9rem;
  }

  .form-input {
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 999px;
  }

  .form-hint {
    font-size: 0.75rem;
    margin-top: -2px;
  }

  .btn-primary {
    width: 100%;
    min-height: 54px;
    padding: 12px 16px;
    font-size: 0.95rem;
    min-width: unset;
  }

  .result-card {
    gap: 16px;
  }

  .result-group {
    gap: 6px;
  }

  .result-label {
    font-size: 0.85rem;
  }

  .result-input {
    padding: 10px 12px;
    font-size: 16px;
    width: 100%;
  }

  .result-display {
    flex-direction: column;
    gap: 10px;
  }

  .result-display .result-input {
    width: 100%;
  }

  .result-display .btn-secondary {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .footer {
    padding: 20px 15px 15px;
    margin-top: 30px;
    font-size: 0.9rem;
  }

  .expiration-info {
    font-size: 0.75rem;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

/* Reset styles */
textarea {
  resize: vertical;
}

select,
button {
  font-family: inherit;
}

h1, h2, h3 {
  line-height: 1.2;
}

