body {
    background: #f6f8fa;
}

.auto-youtube-description-generator {
    max-width: 900px;
    margin: 40px auto 0 auto;
    padding: 0 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.auto-youtube-description-generator h2 {
    text-align: center;
    font-size: 2.2rem;
    color: #1a2233;
    margin-bottom: 0.3em;
    font-weight: 700;
}

.auto-youtube-description-generator .subtitle {
    text-align: center;
    color: #6a7a90;
    margin-bottom: 2em;
    font-size: 1.1em;
}

.desc-section-card {
    background: linear-gradient(120deg, #7e9fd6 0%, #a7b7d9 100%);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(30,40,80,0.09);
    padding: 20px 20px 10px 20px;
    margin-bottom: 24px;
    position: relative;
    transition: box-shadow 0.2s;
    overflow: hidden; /* Prevents children from overflowing */
    min-width: 0; /* Fixes flexbox/min-width issues on small screens */
}

.desc-section-card:focus-within {
    box-shadow: 0 4px 24px rgba(30,40,80,0.18);
}

.desc-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.08em;
    margin-bottom: 0.2em;
    color: #fff;
}

.desc-section-desc {
    color: #e6eaf3;
    font-size: 0.98em;
    margin-bottom: 0.7em;
    display: block;
}

/* -------- TEXTAREA FIXES -------- */
.desc-section-card textarea {
    width: 100%;
    border-radius: 8px;
    border: none;
    padding: 13px;
    font-size: 1em;
    margin-bottom: 4px;
    background: #f8faff;
    color: #222;
    resize: vertical;
    min-height: 60px;
    max-height: 120px;      /* Prevents overflow */
    overflow-y: auto;       /* Adds scroll when content is too long */
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
    box-sizing: border-box;
    word-break: break-word; /* Ensures long words wrap */
}

.desc-section-card textarea:focus {
    outline: 2px solid #111;
    box-shadow: 0 0 5px #b1b1b1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}
.switch input {display:none;}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #111;
}
input:checked + .slider:before {
    transform: translateX(16px);
}

.desc-actions {
    text-align: center;
    margin: 32px 0 16px 0;
}
.black-btn {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 13px 32px;
    font-size: 1.07em;
    font-weight: 600;
    margin: 0 8px 10px 0;
    cursor: pointer;
    transition: background 0.2s;
}
.black-btn:hover, .black-btn:focus {
    background: #333;
}

.desc-preview {
    margin: 0 auto 30px auto;
    max-width: 700px;
    background: #f5f6fa;
    border-radius: 10px;
    padding: 18px 22px;
    font-size: 1.02em;
    color: #222;
    white-space: pre-wrap;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    min-height: 60px;
    word-break: break-word;
}

@media (max-width: 700px) {
    .auto-youtube-description-generator {
        padding: 0 2vw;
    }
    .desc-preview, .desc-section-card {
        padding: 12px;
    }
    .desc-section-header {
        font-size: 1em;
    }
    .desc-section-card textarea {
        max-height: 90px;   /* Make textarea a bit smaller on mobile */
    }
}
