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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #7c3aed;
  --success: #10b981;
  --danger: #ef4444;
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --text-light: #e2e8f0;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow: 0 0 30px rgba(37, 99, 235, 0.15);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body {
  background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
  color: var(--text-light);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Inter",
    monospace;
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* ==================== HEADER ==================== */
header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 0.6s ease;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.logo {
  font-size: 48px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -1px;
}

header h1 {
  font-size: 32px;
  color: var(--text-light);
  font-weight: 700;
}

header p {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ==================== MAIN LAYOUT ==================== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

/* ==================== FORM SECTION ==================== */
.form-section {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s ease;
}

.form-section h2 {
  font-size: 18px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-darker);
  color: var(--text-light);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* ==================== SIZE SELECTOR ==================== */
.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.size-option {
  position: relative;
}

.size-option input[type="radio"] {
  display: none;
}

.size-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  background: var(--bg-darker);
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.size-option input[type="radio"]:checked + label {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.size-option label:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ==================== BUTTONS ==================== */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

button {
  flex: 1;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.6);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-darker);
  color: var(--text-light);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ==================== PREVIEW SECTION ==================== */
.preview-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.preview-container {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 64px;
  opacity: 0.3;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  object-fit: contain;
  display: none;
}

.preview-image.show {
  display: block;
  animation: fadeIn 0.5s ease;
}

/* ==================== LOADER ==================== */
.loader {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
}

.loader.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loader-text {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==================== STATS ==================== */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 20px;
  background: rgba(37, 99, 235, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
}

.stat-item {
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* ==================== DOWNLOAD BUTTON ==================== */
.download-section {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.download-section.show {
  display: flex;
}

.download-btn {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* ==================== MESSAGES ==================== */
.alert {
  padding: 14px 16px;
  border-radius: 10px;
  margin-top: 15px;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.alert.show {
  display: flex;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #86efac;
}

.alert-icon {
  font-size: 18px;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==================== FOOTER SECTION ==================== */
footer {
  margin-top: 80px;
  border-top: 1px solid var(--border-color);
  padding-top: 40px;
  padding-bottom: 30px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  margin-bottom: 30px;
}

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

.author-title {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.author-name {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.author-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.social-links-footer {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 28px;
  color: var(--text-light);
  line-height: 1;
}

.social-link:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
  color: white;
}

.social-link.github:hover {
  background: linear-gradient(135deg, #1b1b1b, #404040);
  border-color: #404040;
  color: white;
}

.social-link.facebook:hover {
  background: linear-gradient(135deg, #1877f2, #0a66c2);
  border-color: #0a66c2;
  color: white;
}

.social-link.instagram:hover {
  background: linear-gradient(
    135deg,
    #f09433,
    #e6683c,
    #dc2743,
    #cc2366,
    #bc1888
  );
  border-color: #bc1888;
  color: white;
}

.social-link.whatsapp:hover {
  background: linear-gradient(135deg, #25d366, #128c7e);
  border-color: #128c7e;
  color: white;
}

.social-link.telegram:hover {
  background: linear-gradient(135deg, #0088cc, #0088cc);
  border-color: #0088cc;
  color: white;
}

.footer-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-color),
    transparent
  );
  margin: 30px 0;
}

.footer-bottom {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 25px;
    text-align: center;
  }

  .author-name {
    font-size: 20px;
  }

  .social-links {
    justify-content: center;
  }

  .social-link {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }

  footer {
    padding-top: 30px;
    padding-bottom: 20px;
    margin-top: 60px;
  }
}

@media (max-width: 480px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  header h1 {
    font-size: 26px;
  }

  .logo {
    font-size: 36px;
  }

  .form-section,
  .preview-container {
    padding: 20px;
  }

  .preview-container {
    min-height: 300px;
  }

  .size-grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }

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

  button {
    width: 100%;
  }

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

@media (max-width: 480px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .author-title {
    font-size: 12px;
  }

  .author-name {
    font-size: 18px;
  }

  .author-subtitle {
    font-size: 12px;
  }

  .social-link {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .footer-links {
    gap: 12px;
  }

  footer {
    margin-top: 50px;
    padding-top: 25px;
  }
}

@media (max-width: 360px) {
  header h1 {
    font-size: 22px;
  }

  .logo {
    font-size: 32px;
  }

  .form-section,
  .preview-container {
    padding: 18px;
    border-radius: 12px;
  }

  header {
    margin-bottom: 25px;
  }

  .form-group label {
    font-size: 12px;
  }

  input[type="text"],
  input[type="number"],
  select,
  textarea,
  button {
    font-size: 16px;
    padding: 12px 14px;
  }

  .size-grid {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
  }

  .size-option label {
    font-size: 11px;
    padding: 10px;
  }

  .preview-placeholder {
    gap: 12px;
  }

  .placeholder-icon {
    font-size: 48px;
  }

  .preview-container {
    min-height: 250px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-value {
    font-size: 16px;
  }
}
