: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;
}

.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: visible;
}

.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;
}

.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;
}

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



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

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

.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;
}

.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;
}
/* ==========================================================================
   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;
}

#email-description-textarea {
    height: 100px;
    min-height: 80px;
    max-height: 140px;
    resize: vertical;
}

.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;
}

/* 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 - MOBILE FIRST BASE STYLES
   ========================================================================== */
.email-components {
    margin-bottom: 1rem;
}

/* Base styles for mobile (320px and up) */
.email-type-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    margin-bottom: 0.6rem;
}

.email-type-tabs {
    width: 100%;
    justify-content: center;
    display: flex;
    gap: 4px;
    background-color: #f8fafc;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #265BAA20;
}

.email-type-tab {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    border: none;
    background-color: transparent;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.email-type-tab:hover {
    background-color: #265BAA10;
    color: #265BAA;
}

.email-type-tab.active {
    background-color: #265BAA;
    color: white;
    box-shadow: 0 2px 4px rgba(38, 91, 170, 0.15);
}

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

.field-group {
    display: flex;
    flex-direction: column;
}

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

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

#email-keypoints-textarea {
    min-height: 3rem;
    max-height: 8rem;
    resize: vertical;
    font-family: inherit;
}

#received-email-textarea {
    min-height: 3rem;
    max-height: 8rem;
    resize: vertical;
    font-family: inherit;
}

/* Fade animation for field transitions */
.email-fields {
    transition: all 0.3s ease;
}

.field-group {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.field-group.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.field-group.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   RESULT SECTIONS
   ========================================================================== */

.converted-output {
    height: 100%;
    background-color: #f9f9f9;
    border-radius: 0.75rem;
    border: 1px solid #e0e0e0;
    padding: 1rem;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    word-break: break-word;
}

/* For Firefox */
#results-container {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ==========================================================================
   CONFIG BTNS - MOBILE BASE
   ========================================================================== */
.email-configuration-dropdowns-container {
    display: grid;
    grid-template-columns: 1fr;
    /* gap: 0.75rem; */
}

/* ==========================================================================
    RESPONSIVE DESIGN - MOBILE FIRST APPROACH
    Base: Mobile (320px - 479.98px)
    Mobile Large: 480px+
    Tablet: 768px+
    Desktop: 1024px+
    Desktop Large: 1280px+
   ========================================================================== */

/* Mobile Large (480px+) */
@media (min-width: 480px) {
    .email-type-tab {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ToDo: Need to refactor this breakpoint */
@media (max-width: 767px) {
  #result-email-text {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;     /* Firefox */
  }

  #result-email-text::-webkit-scrollbar {
    display: none !important;             /* Chrome, Safari, Opera */
  }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .email-type-section {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .email-type-tabs {
        width: auto;
        justify-content: flex-start;
    }

    .email-type-tab {
        flex: none;
        padding: 6px 12px;
        font-size: 13px;
    }

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

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr 1rem 1fr;
    }

    .separator {
        display: block;
    }

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

    .email-configuration-dropdowns-container {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        column-gap: 1rem;
        row-gap: 0;
    }
}

/* Desktop Large (1280px+) */
@media (min-width: 1280px) {

    /* Large desktop specific enhancements */
    .email-type-section {
        gap: 20px;
    }
}

/* ==========================================================================
   ORIENTATION & SPECIAL CASES
   ========================================================================== */

/* Mobile landscape specifically */
@media (max-width: 767.98px) and (orientation: landscape) {
    .email-type-section {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .email-type-tabs {
        width: auto;
    }

    .email-type-tab {
        flex: none;
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Tablet portrait with good height */
@media (min-width: 768px) and (max-width: 1023.98px) and (orientation: portrait) {
    .email-configuration-dropdowns-container {
        grid-template-columns: 1fr 1fr;
    }
}





/* 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;
}

.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;
}

@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);
    }
}