/**
 * Styles for the [wellnotes_wizard] shortcode interface.
 */


 /* Styles that apply to all pages in the WellNotes wizard. */
.wellnotes-wizard {
    width: 100%;
}

.wellnotes-wizard * {
    box-sizing: border-box;
}

.wellnotes-wizard .main-heading {
    float: none; /* Remove the float on main-heading added by the theme. */
}

/* Turn off the float: left that is added by the theme customizednutritionnewsletters.com. */
.wellnotes-wizard p {
    float: none;
}

.wellnotes-subheading {
    margin: 6px 0 32px 0;
    max-width: 52ch;
    color: #6e7278;
    font-size: 0.9rem;
}

.wellnotes-wizard input[type="date"],
.wellnotes-wizard input[type="text"],
.wellnotes-wizard input[type="search"],
textarea {
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    color: #333;
    font-family: inherit;
    font-size: 1rem;
    height: 50px;
    line-height: 1.5;
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.wellnotes-wizard input[type="date"]:focus,
.wellnotes-wizard input[type="text"]:focus,
.wellnotes-wizard input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: #90BC46;
    box-shadow: 0 0 0 3px rgba(144, 188, 70, 0.1);
}

.wellnotes-wizard input[type="date"]::placeholder,
.wellnotes-wizard input[type="text"]::placeholder,
.wellnotes-wizard input[type="search"]::placeholder,
textarea::placeholder {
    color: #999;
    font-style: italic;
}

.wellnotes-wizard textarea {
    min-height: 130px;
    resize: vertical;
}

.wellnotes-wizard-pill {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 999px;
    color: #333;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wellnotes-wizard-pill:hover {
    border-color: #90BC46;
    background: #f8faf5;
    color: #333;
}

.wellnotes-wizard-pill.active {
    background: #90BC46;
    border-color: #90BC46;
    color: white;
}

.wellnotes-wizard-pill.active:hover {
    background: #99C64B;
    border-color: #99C64B;
}

@media (max-width: 768px) {
    .wellnotes-search-container {
        margin: 16px 0 24px 0;
    }

    .wellnotes-search-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .wellnotes-filters {
        margin: 0.75rem 0;
    }

    .wellnotes-filters .wellnotes-sponsor-filter {
        border-right: none;
        border-bottom: 1px solid #d0d0d0;
        padding-right: 0;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }

    .wellnotes-category-filters {
        margin: 0;
    }

    .wellnotes-category-pill {
        font-size: 0.8125rem;
        padding: 0.4rem 0.875rem;
    }
}

.wellnotes-button {
    align-items: center;
    border-radius: 5px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    display: inline-flex;
    font-weight: 500;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.wellnotes-button svg {
    display: inline-block;
    fill: currentColor;
    height: 1em;
    margin: 0 5px;
    stroke: currentColor;
    vertical-align: middle;
    width: 1em;
}

.wellnotes-button-primary {
    background-color: #90BC46;
    color: white;
}

.wellnotes-button-primary:hover {
    background-color: #99C64B;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: #fff;
}

.wellnotes-button-primary:active {
    background-color: #82A83F;
}

.wellnotes-button-primary:disabled {
    background-color: #aaa;
    cursor: default;
}

.wellnotes-button-secondary {
    color: #666;
    border: 1px solid #bbb;
    background-color: white;
}

.wellnotes-button-secondary:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: black;
    color: black;
}

.wellnotes-button-secondary:active {
    background-color: #444;
}

.wellnotes-loading-spinner {
    margin-top: 1rem;
    color: #666;
    font-size: 1rem;
}

.wellnotes-loading-spinner .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

@media (max-width: 480px) {
    .wellnotes-wizard {
        margin: 1rem auto;
    }
}

/* Styles for Step 1, the listing of articles. */
.wellnotes-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
    margin: 1rem 0;
}

.wellnotes-sponsor-filter {
    display: flex;
    align-items: flex-start;
    padding-right: 1rem;
    border-right: 1px solid #d0d0d0;
}

.wellnotes-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.wellnotes-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* This message appears in the grid of articles. Make it span the full width of the grid. */
.wellnotes-articles > p {
    grid-column: 1 / -1;
}

.wellnotes-article {
    background: #fcfcfc;
    border-radius: 10px;
    border: 1px solid #ccc;
    cursor: default;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.wellnotes-article:not(.wellnotes-article-unavailable):hover {
    border-color: #777777;
    box-shadow: 0 1px 0 oklch(0.9 0.008 90 / 0.8), 0 8px 24px oklch(0.2 0.02 260 / 0.06);
}

.wellnotes-article-thumbnail {
    width: 100%;
    aspect-ratio: 1.9 / 1;
    object-fit: contain;
    border-radius: 10px 10px 0 0;
    background: #f0f0f0;
}

/* Unavailable premium articles (free tier users) */
.wellnotes-article-unavailable {
    opacity: 0.75;
}

.wellnotes-article-unavailable .wellnotes-article-thumbnail {
    filter: grayscale(100%);
}

.wellnotes-article-title {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    padding: 0 1rem;
    margin: 0;
}

.wellnotes-article-peek {
    font-size: 0.8rem;
    font-weight: 100;
    padding: 0 1rem;
    margin: 0;
    line-height: 1.6;
    overflow: auto;
}

.wellnotes-article-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wellnotes-article:has(.wellnotes-article-radio:checked) {
    border-color: #90BC46;
    box-shadow: 0 0 0 2px #90BC46;
}

.wellnotes-article:has(.wellnotes-article-radio:checked) .wellnotes-article-select-btn {
    background-color: #90BC46;
    border-color: #90BC46;
    color: white;
}

.wellnotes-article-actions {
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
    margin-top: auto;
}

.wellnotes-article-select-btn {
    background-color: white;
    border-radius: 999px;
    border: 1px solid black;
    color: black;
    cursor: pointer;
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.wellnotes-article-select-btn:hover {
    background-color: #90BC46;
    color: white;
}

.wellnotes-article-select-btn.disabled {
    background-color: #f0f0f0;
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

.wellnotes-article-select-btn.disabled:hover {
    background-color: #f0f0f0;
    color: #999;
}

.wellnotes-articles-controls {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
}

#wellnotes-load-more:disabled,
#wellnotes-load-more.loading {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.wellnote-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wellnote-badge-sponsored {
    background: #90bc46;
    color: #fff;
}

.wellnote-badge-premium {
    background: #2271b1;
    color: #fff;
}

/* Fade-in animation for newly loaded articles */
.wellnotes-articles .wellnotes-article {
    animation: fadeInUp 0.5s ease-out;
}

/* Unavailable articles fade to 0.75 instead of 1 */
.wellnotes-articles .wellnotes-article-unavailable {
    animation: fadeInUpUnavailable 0.5s ease-out;
}

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

@keyframes fadeInUpUnavailable {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.75;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .wellnotes-articles {
        grid-template-columns: 1fr;
    }

    .wellnotes-load-more {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .wellnotes-articles {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Step 2 - Personalized Note */
.wellnotes-personalized-note-panel {
    background: oklch(0.995 0.003 90);
    border: 1px solid oklch(0.9 0.008 90);
    border-radius: 10px;
    padding: 22px 24px;
    margin-top: 1rem;
}

.wellnotes-personalized-note-panel h2 {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin: 0 0 6px 0;
}

.wellnotes-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.wellnotes-field label {
    font-size: 12px;
    letter-spacing: 0.12em;
    font-weight: 300;
    color: oklch(0.55 0.01 260);
}

.wellnotes-customization-properties {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wellnotes-customization-property {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 8px 0;
    margin: 0 0 8px 0;
    border-bottom: 1px dashed #e0e0e0;
    font-size: 14px;
    font-weight: 400;
    color: #333;
}

.wellnotes-customization-property:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.wellnotes-customization-property input[type="color"] {
    width: 60px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.wellnotes-customization-property input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.wellnotes-customization-property input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.wellnotes-customization-property input[type="color"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wellnotes-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.wellnotes-step-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    gap: 1rem;
}

@media (max-width: 768px) {
    .wellnotes-field-row {
        grid-template-columns: 1fr;
    }
}

/* Step 3, WellNote preview */
.wellnotes-step-3 {
    animation: fadeIn 0.3s ease-in;
}

.wellnotes-preview {
    display: grid;
    grid-template:
        "preview delivery"
        "preview colors"
        "preview navigtation"
        "preview ."
        / 1fr 300px;
    grid-column-gap: 2rem;
    grid-row-gap: 2rem;
}

.wellnotes-preview-loading {
    margin-top: 2rem;
    color: #666;
    font-style: italic;
    text-align: center;
}

.wellnotes-preview-loading svg {
    display: inline-block;
    fill: currentColor;
    height: 1.5em;
    margin: 0 10px;
    vertical-align: middle;
    width: 1.5em;
}

.wellnotes-preview main {
    grid-area: preview;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-height: 400px;
}

.wellnotes-preview aside {
    background: #fcfcfc;
    border-radius: 10px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding: 10px 20px;
}

.wellnotes-preview aside h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.wellnotes-preview aside p {
    font-size: 13px;
    font-weight: 200;
    line-height: 1.2rem;
}

#wellnotes-delivery {
    grid-area: delivery;
}

#wellnotes-colors {
    grid-area: colors;
}

#wellnotes-navigtation {
    grid-area: navigtation;
}

.wellnotes-preview-iframe {
    width: 100%;
    aspect-ratio: 8.5 / 11;
    border: none;
    border-radius: 4px;
    background: #f5f5f5;
}

/* Loading state for iframe */
.wellnotes-preview-content:not([style*="display: none"]) .wellnotes-pdf-iframe {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .wellnotes-preview main {
        padding: 1.5rem;
    }

    .wellnotes-preview {
        grid-template:
            "delivery"
            "colors"
            "preview"
            "navigtation"
            / 1fr;
    }

    .wellnotes-step-controls {
        flex-direction: column-reverse;
    }

    .wellnotes-step-controls button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wellnotes-preview main {
        padding: 1rem;
    }
}
