:root {
    --header-text-color: #485C6E;
    --color-grey-50: #F1F1F1;
    --color-grey-300: #A0A0A0;
    --color-grey-700: #505050;
}

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.active-passive-parent-container {
    background-color: var(--color-blue-500);
}

.main-content-wrapper {
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.content-container {
    background-color: white;
    border: 1px solid var(--color-grey-50);
    box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.header-title {
    font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
    font-weight: 700;
    color: var(--header-text-color);
}

.header-desc {
    font-size: clamp(0.875rem, 1vw + 0.25rem, 1rem);
    font-weight: 400;
    color: var(--header-text-color);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 500px;
    width: 100%;
    box-sizing: border-box;
}

.separator {
    background-color: var(--color-grey-50);
    margin: auto;
    height: 95%;
    display: none;
    width: 0.15rem;
    margin: 0.5;
}

.input-section,
.output-section {
    padding: 0.5rem;
    border: none;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Important for flexbox/grid items */
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-grey-700);
}

/* ==========================================================================
   CONFIGURATIONS BTNS
   ========================================================================== */
.text-format-dropdown-container {
    min-height: 40px;
    display: grid;
    grid-template-columns: 1fr;
    /* Less space for dropdown, more for options */
    gap: 1rem;
    width: 100%;
    align-items: start;
}

#output-format-dropdown-container {
    min-height: 40px;
    width: 100%;
    min-width: 180px;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

/* Style for the tone emphasis options container */
.tone-emphasis-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    /* Reduced bottom margin */
}

.tone-emphasis-container .form-label {
    margin-bottom: 0.75rem;
}

.tone-emphasis-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 0;
    /* Remove any default bottom margin */
}

/* Responsive: Stack on mobile */
@media (max-width: 767px) {
    .text-format-dropdown-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.toggle-container {
    display: flex;
    justify-content: flex-start;
    align-items: start;
    gap: 0.75rem;
    flex-direction: row;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    margin: 0.3rem 0;
    width: 42px;
    /* Reduced from 50px */
    height: 22px;
    /* Reduced from 24px */
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    border-radius: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 16px;
    /* Reduced from 18px */
    width: 16px;
    /* Reduced from 18px */
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-input:checked+.toggle-label {
    background: linear-gradient(135deg, var(--color-primary-light, #3b82f6) 0%, var(--color-primary-dark, #2563eb) 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.toggle-input:focus+.toggle-label {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.toggle-input:checked+.toggle-label:before {
    transform: translateX(20px);
    /* Adjusted for smaller size */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hover effects */
.toggle-label:hover {
    background-color: #cbd5e1;
    transform: scale(1.02);
}

.toggle-input:checked+.toggle-label:hover {
    background: linear-gradient(135deg, var(--color-primary-dark, #2563eb) 0%, #1d4ed8 100%);
}

/* Active state */
.toggle-input:active+.toggle-label:before {
    width: 18px;
}

/* Disabled state */
.toggle-input:disabled+.toggle-label {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

.toggle-input:disabled+.toggle-label:hover {
    transform: none;
    background-color: #f1f5f9;
}

/* Toggle label text */
.toggle-container .form-label,
.toggle-container label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.toggle-container:hover .form-label,
.toggle-container:hover label {
    color: #1f2937;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
    min-height: 250px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    color: #BEBEBE;
    width: 100%;
    box-sizing: border-box;
}

.empty-state h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #757682;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.856rem;
    color: #757682;
    margin: 0;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.action-btns {
    height: 2.3125rem;
    position: relative;
    z-index: 1;
}

.header-action-btns {
    display: flex;
    gap: 0.5rem;
    height: 2.25rem;
}

.btn-primary {
    background: var(--color-primary-light);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--color-primary-dark);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-loading-spinner {
    border: 1px solid #f3f4f6;
    border-top: 1px solid var(--color-primary-light);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}


/* Add these styles to your CSS file */

/* Full Screen Modal Styles */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-modal.show {
    display: flex;
    justify-content: center;
    opacity: 1;
    padding-top: 80px;
}

.fullscreen-modal.closing {
    opacity: 0;
}

.fullscreen-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px; 
    height: 90%;
    max-height: 700px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    margin-bottom: auto;
}

.fullscreen-modal.show .fullscreen-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.fullscreen-modal.closing .fullscreen-modal-content {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
}

.fullscreen-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem; /* Add gap for spacing */
}

.fullscreen-action-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.fullscreen-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--header-text-color, #485C6E);
    margin: 0;
}

.fullscreen-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
    padding: 0;
}

.fullscreen-modal-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.fullscreen-modal-body {
    padding: 24px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   ENHANCED FULLSCREEN MODAL OUTPUT STYLING
   ========================================================================== */

/* ==========================================================================
   ENHANCED FULLSCREEN MODAL OUTPUT STYLING - UPDATED TO MATCH NORMAL OUTPUT
   ========================================================================== */

/* Update the fullscreen-content-display styles to remove internal scrolling */
.fullscreen-content-display {
    flex: 1;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #0f172a; /* Match normal output base text color */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    word-break: break-word;
    font-size: 1rem;
    line-height: 1.6;
    padding: 0 8px 0 0;
    display: flex;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Add new styles for normal format content wrapper */
.fullscreen-normal-content {
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: inherit;
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.fullscreen-content-display {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Enhanced Typography for Fullscreen Content - UPDATED TO MATCH NORMAL OUTPUT */
.fullscreen-content-display h1 {
    font-size: 1.75rem; /* Larger than normal output */
    font-weight: 500;
    color: #1e293b; /* Match normal output */
    margin: 0 0 1.25rem 0;
    line-height: 1.3;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.fullscreen-content-display h2 {
    font-size: 1.5rem; /* Larger than normal output */
    font-weight: 500;
    color: #1e293b; /* Match normal output */
    margin: 0.75rem 0 1rem 0;
    line-height: 1.4;
    position: relative;
}

.fullscreen-content-display h2::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.25rem;
    border-radius: 2px;
}

.fullscreen-content-display h3 {
    font-size: 1.25rem; /* Larger than normal output */
    font-weight: 500;
    color: #1e293b; /* Match normal output */
    margin: 1.5rem 0 0.75rem 0;
    line-height: 1.4;
}

.fullscreen-content-display h4 {
    font-size: 1.125rem; /* Larger than normal output */
    font-weight: 500;
    color: #1e293b; /* Match normal output */
    margin: 1.25rem 0 0.625rem 0;
    line-height: 1.4;
}

.fullscreen-content-display h5 {
    font-size: 1rem; /* Slightly larger than normal output */
    font-weight: 500;
    color: #1e293b; /* Match normal output */
    margin: 1rem 0 0.5rem 0;
    line-height: 1.4;
}

.fullscreen-content-display h6 {
    font-size: 0.9375rem; /* Slightly larger than normal output */
    font-weight: 500;
    color: #1e293b; /* Match normal output */
    margin: 0.875rem 0 0.5rem 0;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.fullscreen-content-display p {
    font-size: 1.0625rem; /* Slightly larger than normal output */
    line-height: 1.7;
    color: #1f2937; /* Match normal output */
    margin: 0 0 0.5rem 0;
    text-align: justify;
}

.fullscreen-content-display strong {
    font-weight: 500;
    color: #1e293b; /* Match normal output */
}

.fullscreen-content-display em {
    font-style: italic;
    color: #111827; /* Match normal output */
    font-weight: 450;
}

.fullscreen-content-display u {
    text-decoration: underline;
    text-decoration-color: #1f2937; /* Match normal output */
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Enhanced List Styling for Fullscreen - UPDATED TO MATCH NORMAL OUTPUT */
.fullscreen-content-display ul {
    margin: 1rem 0 1.25rem 0;
    padding-left: 0;
    list-style: none;
}

.fullscreen-content-display ul li {
    font-size: 1.0625rem; /* Slightly larger than normal output */
    line-height: 1.6;
    color: #1f2937; /* Match normal output */
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.fullscreen-content-display ul li::before {
    content: '•';
    color: #1f2937; /* Match normal output */
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.125rem;
}

.fullscreen-content-display ol {
    margin: 1rem 0 1.25rem 0;
    padding-left: 1.5rem;
    counter-reset: item;
}

.fullscreen-content-display ol li {
    font-size: 1.0625rem; /* Slightly larger than normal output */
    line-height: 1.6;
    color: #1f2937; /* Match normal output */
    margin: 0.5rem 0;
    counter-increment: item;
    position: relative;
}

.fullscreen-content-display ol li::before {
    content: counter(item) '.';
    color: #1e293b; /* Match normal output */
    font-weight: 600;
    margin-right: 0.625rem;
}

/* Code and Pre styling for Fullscreen HTML/Markdown formats - MATCH NORMAL OUTPUT */
.fullscreen-content-display pre {
    background: #1e293b; /* Match normal output */
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 0.9375rem; /* Slightly larger than normal output */
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid #334155; /* Match normal output */
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}

.fullscreen-content-display code {
    background: #f1f5f9; /* Match normal output */
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9375rem; /* Slightly larger than normal output */
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    border: 1px solid #e2e8f0; /* Match normal output */
}

.fullscreen-content-display pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Blockquote styling for Fullscreen - MATCH NORMAL OUTPUT */
.fullscreen-content-display blockquote {
    background: #f8fafc; /* Match normal output */
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    font-style: italic;
    color: #475569; /* Match normal output */
    border-radius: 0 6px 6px 0;
}

/* Table styling for Fullscreen (if any) - MATCH NORMAL OUTPUT */
.fullscreen-content-display table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9375rem; /* Slightly larger than normal output */
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fullscreen-content-display th,
.fullscreen-content-display td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.fullscreen-content-display th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b; /* Match normal output */
}

.fullscreen-normal-content::-webkit-scrollbar {
    width: 8px;
}

.fullscreen-normal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.fullscreen-normal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 4px;
}

.fullscreen-normal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}

/* Firefox scrollbar for normal content in fullscreen - PREVIOUS STYLE */
.fullscreen-normal-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Responsive adjustments for fullscreen - UPDATED */
@media (max-width: 768px) {
    .fullscreen-content-display {
        padding: 16px 12px 16px 16px;
    }
    
    .fullscreen-content-display h1 {
        font-size: 1.5rem;
    }
    
    .fullscreen-content-display h2 {
        font-size: 1.25rem;
    }
    
    .fullscreen-content-display h3 {
        font-size: 1.125rem;
    }
    
    .fullscreen-content-display h4 {
        font-size: 1rem;
    }
    
    .fullscreen-content-display p,
    .fullscreen-content-display li {
        font-size: 0.9375rem;
        line-height: 1.6;
    }
    
    .fullscreen-content-display h2::before {
        left: -0.75rem;
    }
}

@media (max-width: 480px) {
    .fullscreen-content-display h1 {
        font-size: 1.375rem;
    }
    
    .fullscreen-content-display h2 {
        font-size: 1.125rem;
    }
    
    .fullscreen-content-display p,
    .fullscreen-content-display li {
        font-size: 0.875rem;
    }
}

/* Special styling for different output formats in fullscreen - MATCH NORMAL OUTPUT */
.fullscreen-content-display[data-format="html"] pre,
.fullscreen-content-display[data-format="markdown"] pre {
    background: #0f172a; /* Match normal output */
    border: 1px solid #1e293b; /* Match normal output */
}

.fullscreen-content-display[data-format="html"] code,
.fullscreen-content-display[data-format="markdown"] code {
    background: #0f172a; /* Match normal output */
    color: #e2e8f0; /* Match normal output */
    border: 1px solid #1e293b; /* Match normal output */
}

/* Animation for fullscreen content loading */
/* .fullscreen-content-display > * {
    animation: fadeInFullscreen 0.8s ease-in-out both;
} */

@keyframes fadeInFullscreen {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for fullscreen elements */
/* .fullscreen-content-display > *:nth-child(1) { animation-delay: 0.1s; }
.fullscreen-content-display > *:nth-child(2) { animation-delay: 0.2s; }
.fullscreen-content-display > *:nth-child(3) { animation-delay: 0.3s; }
.fullscreen-content-display > *:nth-child(4) { animation-delay: 0.4s; }
.fullscreen-content-display > *:nth-child(n+5) { animation-delay: 0.5s; } */

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .fullscreen-modal-content {
        width: 95%;
        height: 85%;
        margin: 20px;
    }
    
    .fullscreen-modal-header {
        padding: 16px 20px;
    }
    
    .fullscreen-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .fullscreen-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }
}

/* Special styling for fullscreen button with text */
.btn-secondary#fullscreen-btn {
    width: auto;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #F9FAFB;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #E5E7EB;
}

.btn-secondary:disabled {
    background-color: #F5F5F5;
    color: #A1A1AA;
    border-color: #E5E5E5;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.p-2 {
    padding: 0.5rem;
}

/* Icon styling */
.expand-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-icon, .download-icon, .code-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Demo styling */
.demo-container {
    padding: 2rem;
    background-color: #ffffff;
    margin: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}


/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



.btn-secondary {
    border: 1px solid var(--color-grey-50);
    box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.12);
    width: 2.25rem;
    height: auto;
    background-color: white;
    color: #485C6E;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 0.375rem;
    /* optional: subtle rounding */
}

/* Hover state */
.btn-secondary:hover:not(:disabled) {
    background-color: #F9FAFB;
    /* light gray */
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #E5E7EB;
    /* slightly darker border on hover */
}

/* Disabled state */
.btn-secondary:disabled {
    background-color: #F5F5F5;
    color: #A1A1AA;
    border-color: #E5E5E5;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================================================
   INPUT TEXTAREA LIMIT
   ========================================================================== */

.input-group-custom {
    position: relative;
}

.input-group-custom .form-control {
    min-height: 200px;
    /* Increased from 80px */
    max-height: 250px;
    /* Increased from 140px */
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}

.form-control::placeholder {
    color: #9ca3af;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #6b7280;
    background: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.char-limit-warning {
    color: #f59e0b;
}

.char-limit-error {
    color: #ef4444;
}

.form-label {
    font-size: 14px;
    font-weight: 700;
    color: #757682;
    margin-bottom: 0.4rem;
}

.form-label-description {
    font-size: 12px;
    font-weight: 400;
    color: #717171;
    margin-bottom: 0.4rem;
}

/* Show '*' mark in red for required labels */
.form-label.required::after {
    content: " *";
    color: red;
    font-weight: 700;
}

/* Show (Optional) in gray for optional labels */
.form-label.optional::after {
    content: " (Optional)";
    font-weight: 400;
    color: #A0A0A0;
}

/* Email Components */
/* Email Components Styles */
.email-components {
    margin-bottom: 1rem;
}

.email-type-section {
    margin-bottom: 16px;
}

.email-type-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.email-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.email-type-tab {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.email-type-tab:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.email-type-tab.active {
    background-color: var(--color-primary-light);
    color: white;
}

.email-fields {
    display: grid;
    gap: 0.8rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.field-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-grey-700);
    margin-bottom: 6px;
}

.field-label .optional {
    font-weight: 400;
    color: var(--color-grey-300);
}

.field-input {
    padding: 10px 12px;
    max-height: 2.315rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background-color: #ffffff;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.field-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.field-input::placeholder {
    color: #9ca3af;
}

.send-recipient-grid {
    display: grid;
    /* grid-template-columns: 1fr 1fr; */
    gap: 0.8rem;
}

.subject-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

/* Scroll bar */
/* For Chrome, Edge, Safari */
#results-container::-webkit-scrollbar {
    width: 6px;
}

#results-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    /* No background behind track */
}

#results-container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 6px;
}

#results-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* For Firefox */
#results-container {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}


/* Mobile-first approach - Base styles for smallest screens */
.text-stats {
    display: flex;
    gap: 0.5rem;
    justify-content: end;
    align-items: stretch;
    width: 100%;
    flex-wrap: wrap;
}

.stat-item {
    background: #ffffff;
    border: 0.0625rem solid #e9ecef;
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    min-width: fit-content;
    text-align: center;
    flex-shrink: 0;
}

.stat-item:hover {
    border-color: #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
    /* transform: translateY(-0.0625rem); */
}

.stat-value {
    color: #495057;
    font-weight: 600;
}

/* ==========================================================================
    RESPONSIVE DESIGN - BREAKPOINTS
    @media (max-width: 479px) {}
    @media (min-width: 480px) {}
    @media (min-width: 768px) {}
    @media (min-width: 1024px) {}
    @media (min-width: 1280px) {}
   ========================================================================== */

/* Small Mobiles */
@media (max-width: 479px) {
    /* smallest mobile devices */
    .main-content-wrapper {
        padding: 1rem;
    }
    
    .input-section,
    .output-section {
        padding: 0.25rem;
    }
    
    .email-type-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .email-type-tab {
        width: 100%;
        text-align: center;
    }
    
    /* Hide fullscreen button on small mobile devices */
    .btn-secondary#fullscreen-btn,
    #fullscreen-btn {
        display: none !important;
    }
}

/* Mobile Only */
@media (min-width: 480px) and (max-width: 767px) {
    /* All mobile devices */
    .text-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.625rem;
        align-items: center;
    }
    
    .stat-item {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    
    /* Hide fullscreen button on mobile devices */
    .btn-secondary#fullscreen-btn,
    #fullscreen-btn {
        display: none !important;
    }
}

/* Tablet and Up */
@media (min-width: 768px) {

    .text-stats {
        gap: 0.75rem;
        justify-content: end;
    }
    
    .stat-item {
        flex: none;
        min-width: fit-content;
        padding: 0.5rem 1rem;
    }
}

/* Desktop and Up */
@media (min-width: 1024px) {
    /* Desktop and larger */

    .content-grid {
        grid-template-columns: 1fr 1rem 1fr;
    }

    .separator {
        display: block;
    }

    .input-action-btns-container {
        flex-direction: row;
    }

    .send-recipient-grid {
        grid-template-columns: 1fr 1fr;
    }

    .story-configuration-dropdowns-container {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .story-advanced-dropdowns-container {
        grid-template-columns: 1fr 1fr;
    }

    .text-stats {
        /* gap: 1rem; */
    }
    
    .stat-item {
        /* padding: 0.5rem 1.25rem;
        font-size: 0.875rem; */
    }

}

@media (max-width: 768px) and (min-height: 1024px) {
    /* Target tablet portrait */
}

/* Large Desktop and Up */
@media (min-width: 1280px) {
    /* Large desktop and larger */
    .text-stats {
        /* gap: 1rem; */
    }
    
    .stat-item {
        /* padding: 0.625rem 1.5rem; */
        /* font-size: 0.9375rem; */
    }
}

/* =======================
   ORIENTATION BREAKPOINTS
   ======================= */

/* Portrait orientation */
@media (orientation: portrait) {
    /* Portrait mode styles */
}

/* Landscape orientation */
@media (orientation: landscape) {
    /* Landscape mode styles */
}

/* Mobile landscape specifically */
@media (max-width: 767px) and (orientation: landscape) {
    /* Mobile in landscape */
}


/* Initial state: collapsed */
.collapse-transition {
    max-height: 0;
    /* overflow: hidden; */
    transition: max-height 0.4s ease-in-out;
}

/* Expanded state */
.collapse-transition.open {
    max-height: 500px;
    /* Adjust based on actual content height */
}





/* Modal Styles : ToDo: Place the modal style in global css as it will be a reusable component*/

/* For toast msg */
#messageBox {
    position: absolute;
    top: 10%;
    right: 1%;
    z-index: 9999;
    max-width: 40%;
    width: auto;
}

.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.custom-modal.closing {
    opacity: 0;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.custom-modal.closing .modal-content {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
}

.modal-header {
    padding: 24px 24px 0;
    position: relative;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.modal-body {
    padding: 20px 24px;
}

.modal-description {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-secondary:hover {
    border-color: #cbd5e1;
    color: #475569;
}

/* Mobile responsiveness for modals */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 16px 0;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 0 16px 16px;
        flex-direction: column;
    }
    
    .modal-btn-primary,
    .modal-btn-secondary {
        width: 100%;
    }
    
    #messageBox {
        max-width: 90%;
        right: 5%;
    }
}

/* ==========================================================================
   ENHANCED OUTPUT SECTION STYLING
   ========================================================================== */

.converted-output {
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%); /* Lighter background for better contrast */
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    color: #0f172a; /* Much darker base text color */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    word-break: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    position: relative;
}

.converted-output:hover {
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Enhanced Typography for Output Content */
.converted-output h1 {
    font-size: 1.5rem;
    font-weight:500;
    color: #1e293b;
    margin: 0 0 1rem 0;
    line-height: 1.3;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.converted-output h2 {
    font-size: 1.25rem;
    font-weight:500;
    color: #1e293b;
    margin: 0.50rem 0 0.50rem 0;
    line-height: 1.4;
    position: relative;
}

.converted-output h2::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 2px;
}

.converted-output h3 {
    font-size: 1.1rem;
    font-weight:500;
    color: #1e293b;
    margin: 1.25rem 0 0.5rem 0;
    line-height: 1.4;
}

.converted-output h4 {
    font-size: 1rem;
    font-weight:500;
    color: #1e293b;
    margin: 1rem 0 0.5rem 0;
    line-height: 1.4;
}

.converted-output h5 {
    font-size: 0.95rem;
    font-weight:500;
    color: #1e293b;
    margin: 0.875rem 0 0.375rem 0;
    line-height: 1.4;
}

.converted-output h6 {
    font-size: 0.9rem;
    font-weight:500;
    color: #1e293b;
    margin: 0.75rem 0 0.375rem 0;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.converted-output p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #1f2937;
    text-align: justify;
    margin-bottom: 15px;
}


.converted-output strong {
    font-weight:500;
    color: #1e293b;
}

.converted-output em {
    font-style: italic;
    color: #111827;
    font-weight: 450;
}

.converted-output u {
    text-decoration: underline;
    text-decoration-color: #1f2937;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Enhanced List Styling */
.converted-output ul {
    margin: 0.75rem 0 1rem 0;
    padding-left: 0;
    list-style: none;
}

.converted-output ul li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f2937;
    margin: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.converted-output ul li::before {
    content: '•';
    color: #1f2937;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1rem;
}

.converted-output ol {
    margin: 0.75rem 0 1rem 0;
    padding-left: 1.25rem;
    counter-reset: item;
}

.converted-output ol li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f2937;
    margin: 0.3rem 0;
    counter-increment: item;
    position: relative;
}

.converted-output ol li::before {
    content: counter(item) '.';
    color: #1e293b;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Code and Pre styling for HTML/Markdown formats */
.converted-output pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.8125rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    line-height: 1.5;
    overflow-x: auto;
    border: 1px solid #334155;
}

.converted-output code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    border: 1px solid #e2e8f0;
}

.converted-output pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Blockquote styling */
.converted-output blockquote {
    background: #f8fafc;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    font-style: italic;
    color: #475569;
    border-radius: 0 6px 6px 0;
}

/* Table styling (if any) */
.converted-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.8125rem;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.converted-output th,
.converted-output td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.converted-output th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

/* Enhanced scrollbar for output content */
.converted-output::-webkit-scrollbar {
    width: 8px;
}

.converted-output::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.converted-output::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 4px;
}

.converted-output::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}

/* Firefox scrollbar */
.converted-output {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Responsive adjustments for output */
@media (max-width: 767px) {
    .converted-output {
        padding: 1rem;
    }
    
    .converted-output h1 {
        font-size: 1.375rem;
    }
    
    .converted-output h2 {
        font-size: 1.125rem;
    }
    
    .converted-output h3 {
        font-size: 1rem;
    }
    
    .converted-output p,
    .converted-output li {
        font-size: 0.8125rem;
    }
    
    .converted-output h2::before {
        left: -0.5rem;
    }
}

/* Special styling for different output formats */
.converted-output[data-format="html"] pre,
.converted-output[data-format="markdown"] pre {
    background: #0f172a;
    border: 1px solid #1e293b;
}

.converted-output[data-format="html"] code,
.converted-output[data-format="markdown"] code {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #1e293b;
}

/* Animation for content loading */
.converted-output > * {
    animation: fadeInContent 0.6s ease-in-out both;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

