/* ------------------------------
   Global Reset & Base Styles
------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", "Poppins", sans-serif;
    background: #f7f7f9;
    color: #222;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

/* ------------------------------
   Header & Navigation
------------------------------ */
header {
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.navbar {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.navbar a {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    padding-bottom: 4px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.navbar a:hover {
    color: #0077ff;
    border-bottom: 2px solid #0077ff;
}

/* ------------------------------
   Main Layout
------------------------------ */
main {
    flex: 1;
    width: min(900px, 90%);
    margin: 2rem auto;
}

/* ------------------------------
   Form Styling
------------------------------ */
#ubbiDubbiForm, 
#ubbiDubbiToEnglishForm,
#pigLatinForm,
#morseCodeForm,
#morseCodeToEnglishForm {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#ubbiDubbiForm input, 
#ubbiDubbiToEnglishForm input,
#pigLatinForm input,
#morseCodeForm input,
#morseCodeToEnglishForm input {
    flex: 1;
    padding: 0.9rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.2s ease;
}

#ubbiDubbiForm input:focus, 
#ubbiDubbiToEnglishForm input:focus,
#pigLatinForm input:focus,
#morseCodeForm input:focus,
#morseCodeToEnglishForm input:focus {
    border-color: #0077ff;
    outline: none;
}

#ubbiDubbiForm button, 
#ubbiDubbiToEnglishForm button,
#pigLatinForm button,
#morseCodeForm button,
#morseCodeToEnglishForm button {
    padding: 0.9rem 1.4rem;
    background: #0077ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s ease;
}

#ubbiDubbiForm button:hover, 
#ubbiDubbiToEnglishForm button:hover,
#pigLatinForm button:hover,
#morseCodeForm button:hover,
#morseCodeToEnglishForm button:hover {
    background: #005fcc;
}

/* ------------------------------
   Translation Output
------------------------------ */
#translation {
    background: #ffffff;
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#copyBtn {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    background: #222;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease;
}

#copyBtn:hover {
    background: #000;
}

/* ------------------------------
   Info Sections (Cards)
------------------------------ */
.description-container,
.learning-container {
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.description-title,
.instructions-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.description {
    font-size: 1rem;
    color: #444;
}

.instructions {
    list-style: disc;
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.6rem;
}

/* ------------------------------
   Footer
------------------------------ */
footer {
    background: #ffffff;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #e5e5e5;
    margin-top: auto;
}

footer span {
    font-weight: 600;
    color: #0077ff;
}

.affiliate-section {
  background: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  margin-top: 3rem;
  text-align: center;
  font-family: 'Segoe UI', sans-serif;
}

.affiliate-section h2 {
  color: #2E2E2E;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.affiliate-intro {
  color: #2E2E2E;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.affiliate-card {
  background: white;
  padding: 1.5rem;
  border-radius: 14px;
  text-decoration: none;
  color: #2E2E2E;
  border: 2px solid #FF6F61;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.affiliate-card:hover {
  transform: translateY(-4px);
  border-color: #4DA8DA;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.affiliate-card h3 {
  margin-bottom: 0.5rem;
  color: #FF6F61;
}

.affiliate-card p {
  font-size: 0.95rem;
  color: #2E2E2E;
}


/* ------------------------------
   Responsive Tweaks
------------------------------ */
@media (max-width: 600px) {
    #translateForm {
        flex-direction: column;
    }

    #translateForm button {
        width: 100%;
    }
}
