/**
 * Account button/popover widget
 */
.eya-for-you-menu {
    position: relative;
}

.eya-for-you-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.eya-for-you-toggle img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.eya-for-you-toggle-chevron {
    transition: transform 0.3s ease;
    display:block;
}

@media(min-width: 1024px) {
    .eya-for-you-toggle-chevron {
        display:none;
    }
}

.eya-for-you-toggle[aria-expanded="true"] {
    background-color: rgba(0, 0, 0, 0.05);

    .eya-for-you-toggle-chevron {
        transform: rotate(180deg);
    }
}

.eya-for-you-popover {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #E4E7EC;
    border-radius: 0.75rem;
    display:none;
    margin-bottoM: 1rem;
}
@media(min-width: 768px){
    .eya-for-you-popover {
        position: absolute;
        top: 100%;
        right: 0;
        min-width: 200px;
        z-index:100;
    }
}

.eya-for-you-popover.active {
    display: block;
}

.eya-for-you-user-info {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.eya-user-name {
    font-weight: bold;
    margin: 0 0 4px;
}

.eya-user-email {
    color: #666;
    margin: 0;
    font-size: 0.9em;
}

.eya-for-you-menu-items {
    padding: 8px 0;
}

.eya-for-you-menu-items a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s;
}

.eya-for-you-menu-items a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.eya-for-you-menu-items img {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    object-fit: contain;
}

.eya-logout-link {
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 8px;
}

.eya-for-you-toggle .eya-user-button-name {
    margin-left: 8px;
    font-size: 14px;
}

/**
 * Forms
 */
.eya-form {
    background: #fff;
    border: solid 1px #E4E7EC;
    border-radius: 12px;
    padding: 1rem;
}
@media(min-width: 768px){
    .eya-form {
        padding: 2rem;
    }
}

.eya-form--login,
.eya-form--signup,
.eya-form--password-reset,
.eya-form--forgotten-password {
    border:0;
    padding:0;
}

.eya-form .form-row {
    margin-bottom: 1rem;
    position: relative;
}
.eya-form .form-row--full {
    grid-column: 1/-1;
}

.eya-form label {
    display: block;
    margin-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
}

.eya-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
}
.eya-password-toggle svg path {
    transition: fill 0.3s ease;
}
.eya-password-toggle.visible path {
    fill: #900;
}

.eya-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.eya-form input[type="text"],
.eya-form input[type="email"],
.eya-form input[type="password"] {
    width: 100%;
    border: solid 1px #E4E7EC;
    border-radius: 10px;
}

.eya-form-error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}
.eya-form-error-message.success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.eya-form input.error {
    border-color: #dc2626;
}

/**
 * Login Page
 */
.eya-login-page .eya-auth-form-wrapper > * {
    width: clamp(300px, 100%, 360px);
    margin-left: auto;
    margin-right: auto;
}
html .eya-login-page h1 {
    margin-bottom: 1rem;
    font-size: 1.875rem;
    line-height: 2.375rem;
}

/**
 * Forgotten Password Page
 */
.eya-forgotten-password-page .eya-auth-form-wrapper > * {
    width: clamp(300px, 100%, 360px);
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}
html .eya-forgotten-password-page h1 {
    margin-bottom: 1rem;
    font-size: 1.875rem;
    line-height: 2.375rem;
}

/**
 * Password Reset Page
 */
.eya-password-reset-page .eya-auth-form-wrapper > * {
    width: clamp(300px, 100%, 360px);
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}
html .eya-password-reset-page h1 {
    margin-bottom: 1rem;
    font-size: 1.875rem;
    line-height: 2.375rem;
}
.eya-forgotten-password-page .eya-auth-form-wrapper .icon {
    position: relative;
    width: 56px;
    height: 56px;
    line-height: 0;
}
.eya-forgotten-password-page .eya-auth-form-wrapper .icon::before {
    content: "";
    display: block;
    width:768px;
    height: 768px;
    background: url(../img/password-reset-sent-background.svg) no-repeat;
    background-size: 100%;
    position: absolute;
    pointer-events: none;
    left: -50%;
    top: -50%;
    transform: translate(-328px, -328px);
}

/**
 * Signup page
 */
.eya-signup-page .eya-auth-form-wrapper > * {
    width: clamp(300px, 100%, 360px);
    margin-left: auto;
    margin-right: auto;
}
html .eya-signup-page h1 {
    margin-bottom: 1rem;
    font-size: 1.875rem;
    line-height: 2.375rem;
}

.eya-auth-intro {
    margin-bottom: 1.5em;
}

.eya-auth-step-indicator {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 1rem;
    margin-right: auto;
}
.eya-auth-step-indicator-item {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E4E7EC;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.eya-auth-step-indicator-item:hover {
    transform: scale(1.2);
}

.eya-auth-step-indicator-item.complete {
    background: var(--e-global-color-secondary);
    opacity: 0.7;
}

.eya-auth-step-indicator-item.current {
    background: var(--e-global-color-secondary);
    opacity: 1;
}

/**
 * Preferences page
 */
body.eya-preferences-page { background: #F9FAFB; }
body.eya-for-you-page { background: #fff; }

.eya-preferences-header--inner,
.eya-preferences-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1rem;
}
@media(min-width: 768px){
    .eya-preferences-header--inner,
    .eya-preferences-section {
        padding: 2rem;
    }
}


/* HEADER/TITLE BLOCK */
.eya-preferences-header--title {
    display: flex;
    align-items: center;
    gap: 1rem;
}
@media(max-width: 767px){
    html .eya-preferences-header--title h1{
        font-size: 2rem;
    }
}

.eya-preferences-icon {
    width: 48px;
}

.eya-preferences-subtitle {
    margin-left: calc(48px + 1rem);
}

/* PREFERENCE SECTIONS */
@media(min-width: 768px){
    .eya-preferences-section {
        display: grid;
        grid-template-columns: 3fr 9fr;
        gap: 3rem;
    }
}

.eya-preferences-section h2 {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.25rem !important;
    margin: 0 !important;
}

@media(min-width: 768px){
    #eya-personal-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        row-gap: 0;
    }

    #eya-personal-form .eya-form-error-message {
        grid-column: 1/-1;
    }
}

.eya-preferences-section .eya-form-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: solid 1px #E4E7EC;
}

.taxonomy-group {
    margin-bottom: 2rem;
}

.taxonomy-group h3 {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.25rem !important;
}

.taxonomy-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.taxonomy-group input[type="checkbox"] {
    margin-right: 0.5rem;
}


/**
 * For You Page
 */

.eya-for-you-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.eya-for-you-post {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.eya-for-you-post:last-child {
    border-bottom: none;
}

.eya-no-posts {
    text-align: center;
    padding: 3rem 0;
}

.eya-preferences-header {
    padding:1rem 0 2rem 0;
    background: #fff;
}
@media(min-width: 768px){
    .eya-preferences-header {
        padding:4rem 0 2rem 0;
    }
}

.eya-preferences-subtitle {
    color: #666;
    margin-top: 0.5rem;
}

.eya-warning-text {
    color: #dc3232;
    margin-bottom: 1rem;
}

.button-danger {
    background: #dc3232;
    border-color: #dc3232;
    color: #fff;
}

.button-danger:hover {
    background: #c02828;
    border-color: #c02828;
}

.eya-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.eya-modal.active {
    display: flex;
}

.eya-modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 4px;
    max-width: 400px;
    width: 90%;
}

.eya-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.eya-section-header {
    margin-bottom: 2rem;
}

.eya-section-subtitle {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
}

.eya-preferences-divider {
    border: none;
    border-top: solid 1px #E4E7EC;
    max-width: 1213px;
    margin: 0 auto;
}

@media(max-width: 767px){
    .eya-danger-zone-content button {
        width: 100%;
    }
}

/**
 * TAGS
 */

 .eya-term-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}

.eya-term-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height:1.25em;
    text-decoration:none;
}
.eya-term-tag--small {
    padding: 4px 8px;
    font-size: 0.875em;
}

.eya-term-tag input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.eya-tag-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eya-tag-icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.eya-term-tag:hover {
    background: #e5e5e5;
}

.eya-term-tag.selected {
    background: #007cba;
    color: white;
    border-color: #006ba1;
}

/* Default state - lighter background, colored border and text */
.eya-term-tag[data-color] {
    background-color: color-mix(in srgb, var(--term-color, #007cba) 10%, white) !important;
    border-color: var(--term-color, #007cba) !important;
    color: var(--term-color, #007cba) !important;
    text-decoration: none !important;
}

/* Selected state - full color background, white text */
.eya-term-tag[data-color].selected {
    background-color: var(--term-color, #007cba) !important;
    border-color: var(--term-color, #007cba) !important;
    color: white !important;
}

/* Hover state - slightly darker than unselected */
.eya-term-tag[data-color]:hover:not(.selected) {
    background-color: color-mix(in srgb, var(--term-color, #007cba) 20%, white) !important;
}

/* For browsers that don't support color-mix, fallback */
@supports not (background-color: color-mix(in srgb, #000 10%, white)) {
    .eya-term-tag[data-color] {
        background-color: rgba(var(--term-color-rgb, 0, 124, 186), 0.1) !important;
    }
    
    .eya-term-tag[data-color]:hover:not(.selected) {
        background-color: rgba(var(--term-color-rgb, 0, 124, 186), 0.2) !important;
    }
}

.eya-term-tag.clicked {
    transform: scale(0.95);
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.eya-term-tag.selected {
    animation: selectPulse 0.2s ease;
} 

a.eya-term-tag {
    text-decoration: none;
    transition: transform 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

a.eya-term-tag .eya-tag-content {
    pointer-events: none;
}

a.eya-term-tag:hover {
    transform: translateY(-2px);
}

/**
 * SIGNUP PAGE
 */
.eya-auth-container .form-section {
    margin: 2rem 0;
}

.eya-auth-container .form-section h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.eya-auth-container .eya-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.eya-auth-container .eya-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.eya-auth-container .eya-checkbox input[type="checkbox"] {
    margin: 0;
}

.eya-auth-container .checkbox-label {
    font-size: 0.9rem;
}

/* Auth Pages */
.eya-auth-page {
    padding: 2rem 1rem;
}

.eya-auth-container {
    max-width: 1280px;
    margin: 0 auto;
    background: #fff;
    display: grid;
    grid-template-columns: 1fr;
}
@media(min-width: 768px){
    .eya-auth-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .eya-auth-form-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

.eya-auth-container .form-section {
    margin: 2rem 0;
}

.eya-auth-container .form-section h3 {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
}

.eya-auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.eya-auth-links a {
    display: block;
    margin: 0.5rem 0;
    color: #666;
    text-decoration: none;
}

.eya-auth-links a:hover {
    color: #333;
    text-decoration: underline;
}


