.ipsum-card {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0ebff 100%);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2.5rem;
}


.ipsum-input-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ipsum-input-field {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.ipsum-input-field label {
    font-weight: 600;
    margin: 6px 0;
    color: #111;
}

.ipsum-input-field input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-weight: 400;
    font-family: "Roboto Slab", serif;
    font-size: 1rem;
    box-sizing: border-box;
    background: #fff;
}

.ipsum-input-note {
    font-size: 0.8rem;
    color: #666;
    margin-top: 3px;
}

/* Custom Dropdown */
.ipsum-custom-select {
    position: relative;
    width: 100%;
}

.ipsum-selected {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
}

.ipsum-selected:after {
    content: "\25BC";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.ipsum-items {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    display: none;
    max-height: 150px;
    overflow-y: auto;
}

.ipsum-items div {
    padding: 10px;
    cursor: pointer;
    font-weight: 400;
}

.ipsum-items div:hover {
    background-color: #f0f4ff;
}

.ipsum-items.show {
    display: block;
}

.ipsum-selected.ipsum-active:after {
    transform: translateY(-50%) rotate(180deg);
}

/* Button */
.ipsum-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 0;
}

.ipsum-gen-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #0F2BC9 0%, #667eea 100%);
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    font-family: "Roboto Slab", serif;
    border: none;
    border-radius: 8px;
    width: 40%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ipsum-gen-btn:hover {
    transform: translateY(1px);
}

/* Result Card - FIXED */
.ipsum-result-card {
    max-width: 900px;
    margin: 1.75rem auto 0 auto;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    background-color: #ffffff;
    padding: .5rem;
    position: relative;
}

/* Main fix: Remove horizontal scroll and gap */
.ipsum-result-content {
    max-height: 400px;
    min-height: 100px;
    overflow-y: auto;        
    overflow-x: hidden;       
    padding: 0.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-family: "Roboto Slab", serif;
    line-height: 1.5;
    white-space: pre-wrap;  
    word-wrap: break-word;    
    overflow-wrap: break-word;
    position: relative;
    border: 0.5px solid #000;
    background-color: #fafafa;
    box-sizing: border-box;   
}

/* Ensure text div also respects boundaries */
#ipsumResult {
    width: 100%;
    max-width: 100%;
    white-space: pre-wrap;    
    word-break: break-word;   
    overflow-wrap: break-word;
    font-family: inherit;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* New Centered Buttons under Result Card */
.ipsum-result-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.7rem 1.5rem;
    background-color: #000;
    color: #fff;
    font-weight: 500;
    font-family: "Roboto Slab", serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 1rem;
}

.action-btn:hover {
    background-color: #0F2BC9;
}

.action-btn i {
    font-size: 1rem;
}


/* Scrollbar styling for better appearance */
.ipsum-result-content::-webkit-scrollbar {
    width: 8px;
}

.ipsum-result-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ipsum-result-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ipsum-result-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* FIX FOR PLAIN TEXT CONTENT */
.plain-text-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    font-family: inherit;
    line-height: 1.5;
}

/* FIX FOR HTML/PRE CONTENT */
.wrap-pre {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    width: 100%;
}

/* Ensure code blocks also wrap */
.language-html {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}


/* Clean formatting for HTML output */
.html-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
    padding: 5px;
    margin: 0;
}

/* Plain text output */
.plain-text-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: inherit;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Words container */
.words-container {
    line-height: 2;
}

.word {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 3px;
}


input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}


/***** Media Query *****/
/***** Standard tablets & landscape phones (≤768px) ******/
@media (max-width: 768px) {
.ipsum-card {
    max-width: 700px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.ipsum-result-card {
    max-width: 700px;
}

.ipsum-gen-btn {
    width: 70%;
}

.ipsum-input-note {
    font-size: 0.75rem;
}
}

/***** Large smartphones & phablets (≤617px) ******/
@media (max-width: 617px) {
.ipsum-card {
    max-width: 500px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.ipsum-result-card {
    max-width: 500px;
}

.ipsum-gen-btn {
    width: 100%;
}

.ipsum-input-row {
    align-items: center;
    flex-direction: column;
}

.ipsum-input-field {
    width: 100%;
}

.ipsum-input-note {
    font-size: 0.75rem;
}
}

/***** Small smartphones (≤450px) ******/
@media (max-width: 450px) {
.ipsum-card {
    max-width: 400px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.ipsum-result-card {
    max-width: 400px;
}

.ipsum-gen-btn {
    width: 100%;
}

.ipsum-input-row {
    align-items: center;
    flex-direction: column;
}

.ipsum-input-field {
    width: 100%;
}

.ipsum-input-note {
    font-size: 0.75rem;
}

.action-btn {
    font-size: 0.85rem;
}


.action-btn i {
    font-size: 0.85rem;
}
}

/***** Extra small phones & older devices (≤365px) ******/
@media (max-width: 365px) {
.ipsum-card {
    max-width: 320px;
    gap: 1.75rem;
    padding: 2.5rem;
}

.ipsum-result-card {
    max-width: 320px;
}

.ipsum-gen-btn {
    width: 100%;
}

.ipsum-input-row {
    align-items: center;
    flex-direction: column;
}

.ipsum-input-field {
    width: 100%;
}

.ipsum-input-note {
    font-size: 0.75rem;
}
}

