body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

/* Navigation styles */
.navigation {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    padding: 0.75rem 2rem;
    max-width: none;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.nav-link.active {
    color: #007bff;
    background-color: #e7f3ff;
}

/* Upload Media Page Styles */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: transparent;
    position: relative;
}

.upload-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}


.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.file-upload-area.dragover {
    border-color: #007bff;
    background: #e7f3ff;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-hint {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    font-size: 1.2rem;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: #333;
}

.file-size {
    font-size: 0.8rem;
    color: #666;
}

.remove-file {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-file:hover {
    background: #c82333;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.upload-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.upload-btn:hover {
    background: #0056b3;
}

.upload-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.upload-results {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.upload-results h3 {
    margin-top: 0;
    color: #333;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.result-url {
    font-family: monospace;
    background: white;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
    margin-right: 1rem;
    word-break: break-all;
}

.copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.copy-btn:hover {
    background: #218838;
}

.copy-btn.copied {
    background: #6c757d;
}

.main-container {
    display: grid;
    grid-template-columns: 4fr 6fr;
    gap: 20px;
    padding: 20px 40px 20px 20px;
    margin: 0;
    box-sizing: border-box;
}

.container {
    background-color: transparent;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: none;
    border-radius: 0;
    box-shadow: none;
    height: fit-content;
    grid-column: 1 / 2;
    position: sticky;
    top: 20px;
    z-index: 10;
    align-self: start;
}


label {
    margin-top: 20px;
}

select, input[type="date"] {
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #fff;
}

select {
    width: 100%;
}


/* Custom Select Box Styling */
.custom-select {
    position: relative;
    font-family: Arial, sans-serif;
}

.custom-select select {
    display: none; /*hide original SELECT element: */
}

.select-selected {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.select-selected:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.select-selected:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    outline: none;
}

/* Style the arrow inside the select element: */
.select-selected:after {
    position: absolute;
    content: "";
    top: 50%;
    right: 15px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-color: #666 transparent transparent transparent;
    transform: translateY(-50%);
}

/* Point the arrow upwards when the select box is open (active): */
.select-selected.select-arrow-active:after {
    border-color: transparent transparent #666 transparent;
    top: 50%;
    transform: translateY(-50%);
}

/* style the items (options), including the selected item: */
.select-items div, .select-selected {
    color: #333;
    padding: 0.75rem;
    border: 1px solid transparent;
    border-color: transparent transparent rgba(0, 0, 0, 0.1) transparent;
    cursor: pointer;
}

/* Style items (options): */
.select-items {
    position: absolute;
    background-color: #fff;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: -1px;
}

/* Hide the items when the select box is closed: */
.select-hide {
    display: none;
}

.select-items div {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-items div:last-child {
    border-bottom: none;
}

.select-items div:hover, .same-as-selected {
    background-color: #f8f9ff;
    color: #007bff;
}

.button-container {
    display: flex;
    gap: 10px;
}

#preview, #submit {
    background-color: #007bff;
    color: #ffffff;
    padding: 10px 20px;
    margin-top: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#preview:hover, #submit:hover {
    background-color: #0056b3;
}

#preview:disabled, #submit:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#preview:disabled:hover, #submit:disabled:hover {
    background-color: #6c757d;
}

#splitTestDropdown {
    display: none; /* Keep it hidden initially */
    width: 60%;
    padding: 10px;
    margin-top: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image:
            linear-gradient(45deg, transparent 50%, gray 50%),
            linear-gradient(135deg, gray 50%, transparent 50%),
            linear-gradient(to right, #ccc, #ccc);
    background-position:
            calc(100% - 20px) calc(1em + 2px),
            calc(100% - 15px) calc(1em + 2px),
            calc(100% - 2.5em) 0.5em;
    background-size:
            5px 5px,
            5px 5px,
            1px 1.5em;
    background-repeat: no-repeat;
}

#response {
    margin-top: 20px;
    padding: 10px;
    /*background-color: #e9ecef;*/
    border-radius: 5px;
    color: #333;
}

.preview-section {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 20px;
    margin-right: 40px;
}

.preview-header {
    margin: 60px 0 0 0;
    color: #333;
    font-weight: bold;
}

.preview-email {
    background-color: white;
    border: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
    min-height: 600px;
}

.draggable {
    width: 10px;
    cursor: ew-resize;
    background-color: #ddd;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .main-container {
        grid-template-columns: 9fr 11fr;
        gap: 20px;
        padding: 20px 40px 20px 20px;
    }

    .container {
        grid-column: 1;
    }

    .preview-email {
        grid-column: 2;
    }
}

@media (max-width: 767px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .container {
        grid-column: 1;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 20px;
    }

    .preview-email {
        grid-column: 1;
        margin-top: 0;
    }
}

/* --- Testing toggle / panel --- */
.testing-toggle {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    cursor: pointer;
    font-weight: 600;
}

.testing-toggle .arrow {
    display: inline-block;
    transition: transform 0.15s ease-in-out;
}

.testing-toggle[aria-expanded="true"] .arrow {
    transform: rotate(90deg);
}

.testing-panel {
    margin-top: 8px;
    margin-bottom: 4px;
    padding: 12px;
    border: 1px dashed #bbb;
    border-radius: 8px;
    background: #fff;
}

.testing-panel .checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox {
    margin-top: 8px;
    margin-bottom: 12px;
}

/* --- Raw HTML area --- */
.raw-html {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#rawHtml {
    width: 95%;
    min-height: 60px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.4;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    resize: vertical;
    white-space: pre;
    overflow-wrap: normal;
}

#copyRaw {
    align-self: flex-start; /* keep button left-aligned under textarea */
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
}

#copyRaw:hover {
    background-color: #5a6268;
}

/* --- Tooltip styles --- */
.testing-panel { overflow: visible; }

.tooltip {
    position: relative;
    display: inline-block; /* keep it tight to the icon */
}

.tooltip-icon {
    display: inline-block;
    margin-left: 6px;
    width: 16px;
    height: 16px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background-color: #6c757d;
    color: #fff;
    font-weight: bold;
    cursor: help;
}

.tooltip-text {
    position: absolute;
    z-index: 20;
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background-color: #333;
    color: #fff;
    text-align: left;
    font-size: 12px;
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);

    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;

    pointer-events: auto;
}

.tooltip:hover .tooltip-text,
.tooltip-text:hover {
    visibility: visible;
    opacity: 1;
}

.subjectlines-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
}

.subjectlines-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.subjectline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
}

.subjectline-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.subjectline-remove {
    border: none;
    background: #eef2f7;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.subjectline-remove:hover { background: #e2e8f0; }

input[type="text"] {
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

/* Make the "+" Add button match the subject line input height */
.subjectlines-controls {
    align-items: stretch; /* ensure the row uses the tallest item (the input) */
}

#addSubjectLine {
    /* stretch to the grid row height (i.e., the input’s height) */
    height: 78%;
    box-sizing: border-box;
    font-size: 20px;

    /* keep horizontal padding, remove vertical padding so heights match perfectly */
    padding-block: 0;          /* top/bottom = 0 */
    padding-inline: 16px;      /* left/right */

    /* center the "+" nicely */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;

    /* keep your existing button look */
    border-radius: 5px;
    min-width: 40px;
    background-color: #28a745;
    color: #ffffff;
}

#addSubjectLine:hover {
    background-color: #218838;   /* darker green on hover */
}

#addSubjectLine:active {
    transform: translateY(0.5px);
}

#addSubjectLine:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40,167,69,.25); /* green focus ring */
}

/* Error message styling */
#response {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    transition: all 0.2s ease;
}

#response:not(:empty) {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* Success message styling */
#response.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Error message styling */
#response.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}


/* Warning message styling */
#response.warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Info message styling */
#response.info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Google Sign-In Button Centering */
.g_id_signin {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* Ensure the Google button container stays centered */
#g_id_onload {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* Override any Google button styling that might cause centering issues */
.g_id_signin > div {
    margin: 0 auto !important;
    display: block !important;
}

/* Download button styling */
.download-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn:hover {
    background-color: #218838;
}

.download-btn:active {
    background-color: #1e7e34;
}

/* Multi-select component styling */
.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-input {
    position: relative;
}

.multi-select-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    box-sizing: border-box;
}

.multi-select-input input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.multi-select-option {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.multi-select-option:hover {
    background-color: #f8f9ff;
    color: #007bff;
}

.multi-select-option:last-child {
    border-bottom: none;
}

.multi-select-no-results {
    padding: 10px;
    color: #666;
    font-style: italic;
    text-align: center;
}

.multi-select-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 20px;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.9rem;
    color: #0066cc;
}

.multi-select-tag .tag-name {
    margin-right: 6px;
}

.multi-select-tag .tag-remove {
    background: none;
    border: none;
    color: #0066cc;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.multi-select-tag .tag-remove:hover {
    background-color: #b3d9ff;
}
