/* ==========================================
   📧 EMAIL GENERATOR SECTION
   Clean, Responsive, Modern
========================================== */

/* -----------------------------
   Base Section
----------------------------- */
#email-generator-section {
    background: linear-gradient(to bottom, #865cff, #3000bb);
    width: 90%;
    max-width: 1200px;
    margin: 50px auto;
    padding: 50px;
    border-radius: 50px;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* -----------------------------
   Header Section
----------------------------- */
.email-generator-header {
    text-align: left;
    width: 100%;
}

.email-generator-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

.email-generator-header p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.email-generator-header-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* title left, arrow right */
    width: 100%;
}

.email-generator-header-left h2 {
    margin: 0;
    /* remove default margin */
    font-size: 2rem;
    font-weight: 600;
}

/* Collapse Button */
.collapse-btn {
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: none;
}

/* -----------------------------
   Generate Button
----------------------------- */
.generate-btn {
    width: 220px;
    height: 50px;
    background: white;
    color: black;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: block;
    transition: background 0.3s ease, transform 0.2s ease;
}

.generate-btn:hover {
    background: #ddd;
    transform: translateY(-2px);
}

/* -----------------------------
   Expanded Section
----------------------------- */
.email-generator-expanded {
    width: 100%;
    border-radius: 40px;
    color: white;
    text-align: left;
    animation: slideDown 0.3s ease-out;
    display: none;
    position: relative;
}

.email-generator-main {
    background-color: #ffffff;
    color: black;
    width: 100%;
    border-radius: 40px;
    padding: 25px;
    text-align: left;
}

/* -----------------------------
   Form Section
----------------------------- */
.email-generator-form {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    width: 95%;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    text-align: left;
    display: block;
    margin-bottom: 8px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

#email-subject,
#email-body {
    flex: 1;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    background-color: #fafafa;
    transition: border-color 0.2s, background 0.2s;
    padding-right: 40px;
}

#email-subject:focus,
#email-body:focus {
    outline: none;
    border-color: #865cff;
    background-color: #fff;
}

#email-subject {
    height: 45px;
}

/* Copy Button */
.copy-btn {
    background: #865cff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.copy-btn:hover {
    background: #6a3bcc;
}

/* -----------------------------
   Loading Animation
----------------------------- */
.loading-animation {
    background-color: #fff;
    display: none;
    width: 100%;
    height: 350px;
    border-radius: 40px;
    padding: 25px;
    margin-bottom: 15px;
}

/* -----------------------------
   Animations
----------------------------- */
@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -----------------------------
   Responsive Styles
----------------------------- */

/* Small Devices ≤ 768px */
@media (max-width: 768px) {
    #email-generator-section {
        padding: 25px;
        border-radius: 30px;
    }

    .email-generator-main {
        padding: 0;
    }

    .email-generator-header h2 {
        font-size: 1.5rem;
    }

    .email-generator-header p {
        font-size: 0.95rem;
    }

    .generate-btn {
        margin: 15px auto 0 auto;
        width: 90%;
        max-width: 200px;
    }

    .email-generator-form {
        width: 100%;
        gap: 15px;
        margin: 0;
    }

    .input-row {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    #email-body {
        min-height: 120px;
    }
}

/* Medium Devices 769px – 992px */
@media (min-width: 769px) and (max-width: 992px) {
    #email-generator-section {
        padding: 50px;
    }

    .email-generator-header p {
        width: 380px;
    }
}

/* Large Devices 993px – 1200px */
@media (min-width: 993px) and (max-width: 1200px) {
    #email-generator-section {
        width: 90%;
    }
}