/**
 * Email Header Analyzer - Full Width Layout
 */
.btn-back,
#new-analysis-btn {
    display: none !important;
}

/* ============================================ */
/* Results Section - Hidden by Default */
/* ============================================ */

.results-wrapper {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.results-wrapper.show {
    display: block !important;
    opacity: 1;
}

/* Input section - visible by default */
.mailauth-input-section {
    display: block;
}

.mailauth-input-section.hide {
    display: none;
}


/* Reset & Base */
.email-analyzer-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #646C9A;
    line-height: 1.6;
}

.email-analyzer-wrapper * {
    box-sizing: border-box;
}

/* Main Section */
.mailauth-main-section {
    background: #ffffff;
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 0 13px 0 rgba(82, 63, 105, 0.05);
}

.mailauth-row {
    display: block;
}

.mailauth-left {
    width: 100%;
    max-width: 100%;
}

/* Typography */
.mailauth-title {
    color: #646C9A;
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 12px 0;
}

.mailauth-text {
    font-family: 'Muli';
    color: #646C9A;
    font-size: 16px;
    font-weight: 200;
    line-height: 1.6;
    margin: 0;
}

/* Input Row (Horizontal Layout) */
.mailauth-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mailauth-input-col {
    flex: 0 0 66.67%;
    max-width: 66.67%;
    padding-right: 0;
}

.mailauth-upload-col {
    flex: 0 0 25%;
    max-width: 25%;
    padding-left: 0;
}

/* Input Group */
.mailauth-input-group {
    display: flex;
    gap: 5px;
}

#top .main_color input.mailauth-input {
    font: 1rem Muli, sans-serif;
    color: #646c9a;
    font-weight: 200;
    margin-bottom: 0px;
    flex: 1;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #EBEDF2;
    background: #F7F8FA !important;
    transition: all 0.3s ease;
}

.mailauth-input:focus {
    outline: none;
    border-color: #5867DD;
}

/* Copy Button */
.btn-mailauth-copy {
    height: 40px;
    width: 40px;
    padding: 0;
    background: #fff;
    border: 1px solid #ABB3EE;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-mailauth-copy:hover {
    background: #025dcc;
    border-color: #025dcc;
}

.btn-mailauth-copy:hover svg path {
    fill: #fff;
}

.btn-mailauth-copy.copied {
    background: #34BFA3;
    border-color: #34BFA3;
}

.btn-mailauth-copy.copied svg path {
    fill: #fff;
}

/* Upload Button */
.btn-upload-header {
    width: 100%;
    height: 40px;
    background: #fff;
    border: 1px solid #646C9A;
    border-radius: 4px;
    color: #646C9A;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 15px;
}

.btn-upload-header:hover {
    background: #025dcc;
    border-color: #025dcc;
    color: #fff;
}

.btn-upload-header:hover svg path {
    fill: #fff;
}

.btn-upload-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-upload-text {
    margin-top: 0px;
    font-family: 'Muli';
    font-weight: 200;
}

/* Check Email Button */
.mailauth-check-email-btn {
    font-family: 'Muli';
    height: 40px;
    padding: 0 24px;
    background: #4875F4;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: 200;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mailauth-check-email-btn:hover {
    background: #025dcc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mailauth-check-email-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Polling Indicator */
.mailauth-polling-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 20px;
    background: #F2F3F8;
    border-radius: 4px;
}

.mailauth-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #EBEDF2;
    border-top-color: #5867DD;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.mailauth-polling-text {
    color: #646C9A;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .mailauth-main-section {
        padding: 20px 16px;
    }

    .mailauth-input-row {
        flex-direction: column;
        gap: 15px;
    }

    .mailauth-input-col,
    .mailauth-or-col,
    .mailauth-upload-col {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
    }

    .mailauth-or-text {
        margin-top: 0;
    }
}

/* Modal Styles - Keep existing modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-container {
    background: white;
    border-radius: 6px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #EBEDF2;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #646C9A;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px 32px;
    border-top: 1px solid #EBEDF2;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.tab-button {
    font-family: 'Muli';
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    background: #F2F3F8;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 200;
    color: #646C9A;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #e8ebf5;
}

.tab-button.active {
    background: white;
    border-color: #4875F4;
    color: #4875F4;
}

.paste-container {
    margin-bottom: 20px;
}

.paste-container label {
    font-family: 'Muli';
    display: block;
    font-weight: 200 !important;
    color: #2c3e50;
    margin-bottom: 8px;
}

.modal-container #tab-paste #header-textarea {
    font-family: 'Muli';
}

.header-textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid #EBEDF2;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: all 0.3s ease;
}

.header-textarea:focus {
    outline: none;
    border-color: #5867DD;
}

.input-help {
    margin-top: 8px;
    font-size: 14px;
    color: #646C9A;
}

.upload-area {
    border: 2px dashed #EBEDF2;
    border-radius: 6px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #5867DD;
    background: #F2F3F8;
}

.upload-area.dragover {
    border-color: #5867DD;
    background: #F2F3F8;
}

.upload-icon svg {
    opacity: 0.4;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    margin: 0 0 8px 0;
}

.upload-subtext {
    font-size: 14px;
    color: #646C9A;
    margin: 0;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #F2F3F8;
    border-radius: 6px;
    margin-bottom: 16px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-text p {
    margin: 0;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
}

.file-size {
    font-size: 14px;
    color: #646C9A;
}

.btn-remove-file {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #646C9A;
    transition: all 0.3s ease;
}

.btn-remove-file:hover {
    color: #F4516C;
}

.privacy-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #F2F3F8;
    border-radius: 6px;
    margin-top: 20px;
}

.privacy-notice svg {
    flex-shrink: 0;
    color: #34BFA3;
}

.privacy-notice p {
    margin: 0;
    font-size: 14px;
    color: #646C9A;
}

.btn {
    font-family: 'Muli';
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 200;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: #4875F4;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #025dcc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: white;
    color: #4875F4;
    border: 1px solid #4875F4;
}

.btn-secondary:hover:not(:disabled) {
    background: #4875F4;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
}

.spinner-large {
    width: 64px;
    height: 64px;
    border: 6px solid #EBEDF2;
    border-top-color: #5867DD;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

.loading-message {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.loading-submessage {
    font-size: 16px;
    color: #646C9A;
    margin: 0;
}

.error-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 400px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 10001;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.toast-icon {
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: #2c3e50;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #646C9A;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.toast-close:hover {
    color: #2c3e50;
}

.results-wrapper {
    margin-top: 30px;
}

.results-header {
    margin-bottom: 32px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #F2F3F8;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #646C9A;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #EBEDF2;
    color: #2c3e50;
}

.modal-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffebee;
    border-radius: 6px;
    margin-top: 16px;
}

.modal-error svg {
    flex-shrink: 0;
}

.modal-error .error-text {
    flex: 1;
    color: #F4516C;
    font-weight: 500;
}