:root {
      --bg1: #0f172a;
      --bg2: #1e293b;
      --card: rgba(255,255,255,0.08);
      --card-border: rgba(255,255,255,0.14);
      --text: #f8fafc;
      --muted: #cbd5e1;
      --accent: #38bdf8;
      --accent-2: #a78bfa;
      --success: #22c55e;
      --warning: #f59e0b;
      --danger: #ef4444;
      --shadow: 0 15px 40px rgba(0,0,0,0.25);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Poppins', sans-serif;
    }

    body {
      min-height: 100vh;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(167, 139, 250, 0.18), transparent 30%),
        linear-gradient(135deg, var(--bg1), var(--bg2));
      padding: 28px;
    }

    .container {
      max-width: 1250px;
      margin: 0 auto;
    }

    .hero {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      gap: 22px;
      margin-bottom: 24px;
    }

    .hero-card, .stats-card, .translator-card, .feature-card, .history-card {
      background: var(--card);
      border: 1px solid var(--card-border);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-radius: 24px;
      box-shadow: var(--shadow);
    }

    .hero-card {
      padding: 30px;
      position: relative;
      overflow: hidden;
    }

    .hero-card::before {
      content: "";
      position: absolute;
      width: 220px;
      height: 220px;
      border-radius: 50%;
      background: linear-gradient(135deg, rgba(56,189,248,0.22), rgba(167,139,250,0.18));
      top: -80px;
      right: -80px;
      filter: blur(10px);
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: 999px;
      background: rgba(255,255,255,0.1);
      color: var(--muted);
      font-size: 13px;
      margin-bottom: 14px;
    }

    h1 {
      font-size: clamp(2rem, 4vw, 3.3rem);
      line-height: 1.15;
      margin-bottom: 12px;
      max-width: 700px;
    }

    .hero p {
      color: var(--muted);
      line-height: 1.7;
      font-size: 15px;
      max-width: 720px;
    }

    .hero-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 22px;
    }

    button, select, textarea, input {
      border: none;
      outline: none;
    }

    .btn {
      cursor: pointer;
      padding: 12px 18px;
      border-radius: 14px;
      font-weight: 600;
      transition: 0.25s ease;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      color: white;
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      filter: brightness(1.05);
    }

    .btn-secondary {
      background: rgba(255,255,255,0.1);
      color: white;
      border: 1px solid rgba(255,255,255,0.1);
    }

    .stats-card {
      padding: 24px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 18px;
    }

    .mini-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 14px;
    }

    .mini-box {
      background: rgba(255,255,255,0.07);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 18px;
      padding: 18px;
    }

    .mini-box h3 {
      font-size: 1.4rem;
      margin-bottom: 6px;
    }

    .mini-box p {
      font-size: 13px;
      color: var(--muted);
    }

    .translator-card {
      padding: 24px;
      margin-bottom: 24px;
    }

    .toolbar {
      display: grid;
      grid-template-columns: 1fr auto 1fr auto;
      gap: 14px;
      align-items: center;
      margin-bottom: 18px;
    }

    .select-box {
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 16px;
      padding: 12px 14px;
    }

    select {
      width: 100%;
      background: transparent;
      color: white;
      font-size: 15px;
      cursor: pointer;
    }

    select option {
      color: black;
    }

    .swap-btn {
      width: 52px;
      height: 52px;
      border-radius: 16px;
      background: linear-gradient(135deg, rgba(56,189,248,0.24), rgba(167,139,250,0.24));
      color: white;
      font-size: 20px;
      cursor: pointer;
      border: 1px solid rgba(255,255,255,0.12);
    }

    .panels {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 18px;
    }

    .panel {
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.09);
      border-radius: 22px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      min-height: 340px;
    }

    .panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
      color: var(--muted);
      font-size: 14px;
    }

    textarea {
      resize: none;
      flex: 1;
      min-height: 250px;
      background: transparent;
      color: white;
      font-size: 16px;
      line-height: 1.7;
    }

    textarea::placeholder {
      color: #94a3b8;
    }

    .translated-output {
      flex: 1;
      font-size: 16px;
      line-height: 1.8;
      color: white;
      overflow-y: auto;
      white-space: pre-wrap;
      word-wrap: break-word;
    }

    .panel-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-top: 14px;
      flex-wrap: wrap;
    }

    .icon-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .icon-btn {
      cursor: pointer;
      background: rgba(255,255,255,0.1);
      color: white;
      border: 1px solid rgba(255,255,255,0.08);
      padding: 10px 12px;
      border-radius: 12px;
      font-size: 13px;
    }

    .char-count, .status {
      color: var(--muted);
      font-size: 13px;
    }

    .main-actions {
      display: flex;
      justify-content: center;
      gap: 12px;
      margin-top: 20px;
      flex-wrap: wrap;
    }

    .translate-btn {
      min-width: 180px;
      font-size: 15px;
    }

    .features-wrap {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 18px;
      margin-bottom: 24px;
    }

    .feature-card, .history-card {
      padding: 22px;
    }

    .feature-card h3, .history-card h3 {
      margin-bottom: 12px;
      font-size: 1.1rem;
    }

    .feature-card p {
      color: var(--muted);
      line-height: 1.7;
      font-size: 14px;
    }

    .history-list {
      display: grid;
      gap: 12px;
      margin-top: 12px;
    }

    .history-item {
      padding: 14px;
      border-radius: 16px;
      background: rgba(255,255,255,0.07);
      border: 1px solid rgba(255,255,255,0.08);
      cursor: pointer;
      transition: 0.25s ease;
    }

    .history-item:hover {
      transform: translateY(-2px);
      background: rgba(255,255,255,0.1);
    }

    .history-item small {
      color: var(--muted);
      display: block;
      margin-bottom: 6px;
    }

    .loader {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255,255,255,0.4);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      vertical-align: middle;
      margin-right: 8px;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    @media (max-width: 1024px) {
      .hero {
        grid-template-columns: 1fr;
      }

      .features-wrap {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 860px) {
      .toolbar {
        grid-template-columns: 1fr;
      }

      .panels {
        grid-template-columns: 1fr;
      }

      .swap-btn {
        width: 100%;
      }
    }

    @media (max-width: 640px) {
      body {
        padding: 16px;
      }

      .hero-card, .stats-card, .translator-card, .feature-card, .history-card {
        border-radius: 20px;
      }

      .mini-grid {
        grid-template-columns: 1fr;
      }
    }