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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #333;
}

.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  padding: 40px;
  animation: fadeIn 0.5s ease-in;
}

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

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5rem;
  color: #1da1f2;
  margin-bottom: 10px;
}

.subtitle {
  color: #657786;
  font-size: 1rem;
}

.input-section {
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#tweetUrl {
  flex: 1;
  min-width: 250px;
  padding: 15px 20px;
  border: 2px solid #e1e8ed;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#tweetUrl:focus {
  outline: none;
  border-color: #1da1f2;
}

.btn-primary {
  padding: 15px 30px;
  background: #1da1f2;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: #1a91da;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4);
}

.btn-primary:disabled {
  background: #aab8c2;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 12px 24px;
  background: white;
  color: #1da1f2;
  border: 2px solid #1da1f2;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: #1da1f2;
  color: white;
}

.loading-section {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e1e8ed;
  border-top-color: #1da1f2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.result-section {
  animation: fadeIn 0.5s ease-in;
}

.result-section h2 {
  text-align: center;
  color: #14171a;
  margin-bottom: 30px;
  font-size: 1.8rem;
}

.preview-container {
  background: #f7f9fa;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.preview-tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid #e1e8ed;
}

.tab-btn {
  flex: 1;
  padding: 15px;
  background: white;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #657786;
  transition: all 0.3s;
}

.tab-btn:hover {
  background: #f7f9fa;
}

.tab-btn.active {
  color: #1da1f2;
  border-bottom-color: #1da1f2;
  background: #f7f9fa;
}

.preview-content {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview {
  display: none;
  width: 100%;
  max-width: 600px;
}

.preview.active {
  display: block;
}

.preview img,
.preview video {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.share-group {
  display: flex;
  border: 2px solid #1da1f2;
  border-radius: 8px;
  overflow: hidden;
}

.share-select {
  padding: 10px 12px;
  border: none;
  border-right: 2px solid #1da1f2;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1da1f2;
  background: white;
  cursor: pointer;
  outline: none;
}

.share-group .btn-secondary {
  border: none;
  border-radius: 0;
}

.share-section {
  text-align: center;
  padding: 15px;
  background: #e8f5e9;
  border-radius: 8px;
  color: #2e7d32;
  font-weight: 600;
}

.error-section {
  padding: 20px;
  background: #ffebee;
  border-radius: 8px;
  color: #c62828;
  text-align: center;
}

.hidden {
  display: none;
}

footer {
  text-align: center;
  margin-top: 30px;
  color: #657786;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
  }

  header h1 {
    font-size: 2rem;
  }

  .input-group {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-secondary {
    width: 100%;
  }
}
