/* AgeOnce Admin Styles */

.ageonce-dashboard {
    max-width: 900px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #212b36;
}

.ageonce-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ageonce-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #161c24;
}

.ageonce-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 0 2px 0 rgba(145, 158, 171, 0.2), 0 12px 24px -4px rgba(145, 158, 171, 0.12);
    padding: 24px 32px;
    margin-bottom: 24px;
    transition: box-shadow 0.3s;
}

.ageonce-card:hover {
    box-shadow: 0 0 2px 0 rgba(145, 158, 171, 0.2), 0 16px 32px -4px rgba(145, 158, 171, 0.20);
}

.ageonce-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    cursor: pointer;
    min-height: 32px;
}

.ageonce-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.ageonce-card-body {
    display: none;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed #e0e0e0;
    animation: fadeIn 0.3s ease-in-out;
}

.ageonce-card-body.open {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.ageonce-form-group {
    margin-bottom: 20px;
}

.ageonce-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #637381;
}

.ageonce-desc {
    font-size: 13px;
    color: #919eab;
    margin-top: 4px;
}

.ageonce-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(145, 158, 171, 0.32);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.ageonce-input:focus {
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
    outline: none;
}

.ageonce-input-with-copy {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
}

.ageonce-input-with-copy .ageonce-input {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.ageonce-input-with-copy .ageonce-copy-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    padding: 0;
    border: 1px solid rgba(145, 158, 171, 0.32);
    border-left: none;
    background: #fafafa;
    color: #637381;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    transition: color 0.2s, background 0.2s;
}

.ageonce-input-with-copy .ageonce-copy-icon:hover {
    color: #212b36;
    background: rgba(145, 158, 171, 0.12);
}

.ageonce-input-with-copy .ageonce-copy-icon:focus {
    outline: none;
}

.ageonce-input-with-copy .ageonce-copy-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ageonce-input-with-copy .ageonce-copy-icon .dashicons-yes {
    color: #4ab866;
}

.ageonce-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.ageonce-badge.dev {
    background: #ffe7d9;
    color: #b72136;
}

.ageonce-badge.prod {
    background: #d8fbde;
    color: #1b806a;
}

.ageonce-btn-primary {
    background: #212b36 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(33, 43, 54, 0.24);
    transition: transform 0.2s;
}

.ageonce-btn-primary:hover {
    background: #454f5b !important;
    transform: translateY(-2px);
}

.ageonce-btn-secondary {
    border-radius: 8px !important;
    font-weight: 600 !important;
    min-height: 38px;
}

.ageonce-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ageonce-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ageonce-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dfe3e8;
    transition: .3s;
    border-radius: 24px;
}

.ageonce-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .ageonce-slider {
    background-color: #212b36;
}

input:checked + .ageonce-slider:before {
    transform: translateX(20px);
}

.ageonce-select + .select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    border-color: rgba(145, 158, 171, 0.32) !important;
    border-radius: 8px !important;
    min-height: 44px !important;
    padding: 4px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #212b36 !important;
    border: none !important;
    border-radius: 6px !important;
    color: #fff !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 5px !important;
}

.ageonce-tabs-nav {
    display: flex;
    border-bottom: 1px solid #dfe3e8;
    margin-bottom: 20px;
    margin-top: 10px;
}

.ageonce-tab-link {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #637381;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-right: 10px;
}

.ageonce-tab-link:hover {
    color: #212b36;
    background: #f4f6f8;
    border-radius: 6px 6px 0 0;
}

.ageonce-tab-link.active {
    color: #212b36;
    border-bottom-color: #212b36;
}

.ageonce-tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.ageonce-tab-content.active {
    display: block;
}

.ageonce-age-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f1f3f5;
}

.ageonce-age-option {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.ageonce-docs-link {
    font-size: 14px;
    color: #637381;
    text-decoration: none;
}

.ageonce-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #b8d9ff;
    background: #eef6ff;
    color: #1f3f66;
    font-size: 14px;
}

.ageonce-notice a {
    color: #0b57d0;
    text-decoration: none;
    font-weight: 600;
}

.ageonce-notice-divider {
    margin: 0 8px;
    color: #6b7f98;
}

.ageonce-notice--hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 28px;
    border: 1px solid rgba(84, 135, 255, 0.35);
    background: linear-gradient(120deg, rgba(8,16,30,0.98) 0%, rgba(11,27,45,0.98) 45%, rgba(8,16,30,1) 100%);
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.ageonce-notice--hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 12% 20%, rgba(33, 209, 167, 0.18), transparent 45%);
    pointer-events: none;
}

.ageonce-notice-image {
    width: 190px;
    max-width: 28%;
    height: auto;
    border-radius: 0;
    background: transparent;
    border: 0;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.ageonce-notice-content {
    min-width: 0;
    flex: 1 1 auto;
    position: relative;
    z-index: 1;
}

.ageonce-notice-content p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.8);
    max-width: 650px;
}

.ageonce-notice-links {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ageonce-notice-link {
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    border-radius: 8px;
    padding: 7px 12px;
}

.ageonce-notice-link--primary {
    color: #0a1e33 !important;
    background: #22d3a9;
}

.ageonce-notice-link--ghost {
    color: #d6e8ff !important;
    border: 1px solid rgba(214, 232, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.ageonce-setup-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ageonce-hero-steps {
    margin-top: 16px;
    max-width: 660px;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.ageonce-setup-step {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid rgba(214, 232, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
}

.ageonce-setup-step.is-done {
    border-color: rgba(34, 211, 169, 0.42);
    background: rgba(34, 211, 169, 0.12);
}

.ageonce-setup-step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #31425a;
    color: #ffffff;
}

.ageonce-setup-step.is-done .ageonce-setup-step-icon {
    background: #22d3a9;
    color: #0a1e33;
}

.ageonce-setup-step-icon .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

.ageonce-setup-step-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.35;
}

.ageonce-setup-step-body strong {
    color: #ffffff;
    font-size: 13.5px;
}

.ageonce-setup-step-body a {
    color: #0b57d0;
    text-decoration: none;
    font-weight: 600;
}

.ageonce-test-connection {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.ageonce-test-result {
    font-size: 13px;
    font-weight: 600;
    color: #637381;
}

.ageonce-test-result.is-success {
    color: #1b806a;
}

.ageonce-test-result.is-error {
    color: #b72136;
}

.ageonce-toast {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 14px;
    position: fixed;
    top: 18px;
    right: 18px;
    width: min(420px, calc(100vw - 36px));
    z-index: 100000;
    box-shadow: 0 16px 30px rgba(16, 24, 40, 0.16);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ageonce-toast .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.ageonce-toast strong {
    display: block;
    font-size: 13px;
}

.ageonce-toast p {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.4;
}

.ageonce-toast--success {
    background: #eefbf6;
    border-color: #b7efda;
}

.ageonce-toast--success .dashicons,
.ageonce-toast--success strong {
    color: #1b806a;
}

.ageonce-toast--success p {
    color: #2b5b4d;
}

.ageonce-toast--error {
    background: #fff2f3;
    border-color: #f2c5ca;
}

.ageonce-toast--error .dashicons,
.ageonce-toast--error strong {
    color: #b72136;
}

.ageonce-toast--error p {
    color: #7d2834;
}

.ageonce-toast--hidden {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.ageonce-next-test {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e7ebef;
    border-radius: 12px;
    background: #fafbfd;
}

.ageonce-next-test strong {
    display: block;
    font-size: 14px;
    color: #212b36;
}

.ageonce-next-test p {
    margin: 6px 0 10px;
    font-size: 13px;
    color: #637381;
}

.ageonce-next-test-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.ageonce-next-test-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid #edf0f2;
    border-radius: 10px;
    background: #ffffff;
}

.ageonce-next-test-item .dashicons {
    color: #212b36;
}

.ageonce-next-test-item b {
    display: block;
    font-size: 13px;
    color: #212b36;
    margin-bottom: 2px;
}

.ageonce-next-test-item span {
    font-size: 12px;
    color: #637381;
    line-height: 1.35;
}

.ageonce-rules-guide {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 18px;
    align-items: center;
    margin: -8px 0 20px;
    padding: 18px 20px;
    border: 1px solid #e8edf2;
    border-radius: 16px;
    background: #f8fafc;
}

.ageonce-rules-guide strong {
    display: block;
    margin-bottom: 4px;
    color: #161c24;
    font-size: 15px;
}

.ageonce-rules-guide p {
    margin: 0;
    color: #637381;
    font-size: 13px;
    line-height: 1.45;
}

.ageonce-rules-guide ol {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 20px;
    color: #454f5b;
    font-size: 13px;
}

@media (max-width: 782px) {
    .ageonce-notice--hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .ageonce-notice-image {
        max-width: 100%;
        width: 220px;
        margin-left: 0;
        align-self: center;
    }

    .ageonce-setup-list {
        grid-template-columns: 1fr;
    }

    .ageonce-next-test-grid {
        grid-template-columns: 1fr;
    }

    .ageonce-rules-guide {
        grid-template-columns: 1fr;
    }

    .ageonce-grid-2 {
        grid-template-columns: 1fr;
    }
}

.ageonce-card-header--static {
    cursor: default;
}

.ageonce-form-group--lg-bottom {
    margin-bottom: 24px;
}

.ageonce-row-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ageonce-label--inline {
    margin-bottom: 0;
    font-weight: 600;
}

.ageonce-desc--tight-top {
    margin: 6px 0 0;
    font-size: 13px;
}

.ageonce-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ageonce-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ageonce-inline-link {
    margin-bottom: 8px;
    font-size: 12px;
    text-decoration: none;
    color: #637381;
    white-space: nowrap;
}

.ageonce-inline-link:hover {
    color: #212b36;
}

.ageonce-redirect-uri-wrap {
    margin-top: 20px;
}

.ageonce-desc--spaced-bottom {
    margin-bottom: 8px;
}

.ageonce-title--section {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 18px;
}

.ageonce-card-title--sm {
    font-size: 16px;
}

.ageonce-form-group--mb {
    margin-bottom: 20px;
}

.ageonce-toggle-label {
    font-weight: 500;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.ageonce-toggle-label .ageonce-checkbox-inline {
    margin-right: 10px;
}

.ageonce-age-selector-label {
    margin-right: 10px;
    font-weight: 600;
    color: #212b36;
}

.ageonce-age-option input {
    margin-right: 5px;
}

.ageonce-tab-link-hidden {
    display: none !important;
}

.ageonce-desc--tab-intro {
    margin-bottom: 15px;
}

.ageonce-rule-section {
    margin-top: 12px;
}

.ageonce-rule-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.ageonce-rule-section-heading strong {
    color: #212b36;
    font-size: 14px;
}

.ageonce-rule-section-heading span {
    color: #919eab;
    font-size: 12px;
}

.ageonce-taxonomy-rule {
    padding: 14px;
    border: 1px solid #edf0f2;
    border-radius: 12px;
    background: #fff;
}

.ageonce-taxonomy-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.ageonce-action-links {
    font-size: 11px;
    white-space: nowrap;
}

.ageonce-selected-count {
    display: inline-flex;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f4f6f8;
    color: #637381;
    font-size: 11px;
    font-weight: 600;
}

.ageonce-advanced-rules {
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed #dfe3e8;
    border-radius: 14px;
    background: #fbfcfd;
}

.ageonce-advanced-rules summary {
    cursor: pointer;
    color: #212b36;
    font-weight: 600;
}

.ageonce-advanced-rules .ageonce-grid-2 {
    margin-top: 12px;
}

.ageonce-select {
    width: 100%;
}

.ageonce-actions {
    margin-top: 24px;
    text-align: right;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 0 2px 0 rgba(145, 158, 171, 0.2), 0 12px 24px -4px rgba(145, 158, 171, 0.12);
    padding: 24px 32px;
    position: sticky;
    bottom: 8px;
    z-index: 10;
}

.ageonce-actions:hover {
    box-shadow: 0 0 2px 0 rgba(145, 158, 171, 0.2), 0 16px 32px -4px rgba(145, 158, 171, 0.20);
}

@media (max-width: 782px) {
    .ageonce-grid-2 {
        grid-template-columns: 1fr;
    }
}
