/* Character Counter Styles for Actions */
.agenticwp-character-counter {
    margin-top: 8px;
    font-size: 13px;
    color: #646970;
    text-align: right;
    font-weight: 500;
}

.agenticwp-character-counter span {
    font-weight: 600;
    color: #1d2327;
}

.agenticwp-character-counter .agenticwp-char-warning {
    color: #bf8700;
}

.agenticwp-character-counter .agenticwp-char-danger {
    color: #d63638;
}

.agenticwp-settings-wrapper {
    margin: 0;
    padding: 0;
}

.agenticwp-settings-wrapper > div:first-of-type {
    margin-top: 20px;
}

.agenticwp-settings-section {
    margin-bottom: var(--agenticwp-space-3xl);
    padding: var(--agenticwp-space-2xl);
    border-radius: var(--agenticwp-radius-lg);
    border: 1px solid var(--agenticwp-border);
    box-shadow: var(--agenticwp-shadow-sm);
    transition: var(--agenticwp-transition);
}

.agenticwp-section-light {
    background: var(--agenticwp-bg-white);
    border-color: var(--agenticwp-border);
}

.agenticwp-section-dark {
    background: var(--agenticwp-bg-light);
    border-color: var(--agenticwp-border-dark);
}

.agenticwp-settings-section h2 {
    margin-top: 0;
    margin-bottom: var(--agenticwp-space-xl);
    font-size: 20px;
    font-weight: 600;
    color: var(--agenticwp-text-primary);
}

.agenticwp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--agenticwp-space-lg);
}

.agenticwp-section-header h2 {
    margin-bottom: 0;
    flex: 1;
}

.agenticwp-section-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: var(--agenticwp-transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--agenticwp-radius-sm);
}

.agenticwp-section-toggle:hover {
    background: var(--agenticwp-bg-light);
}

.agenticwp-section-toggle:focus {
    outline: 2px solid var(--agenticwp-primary);
    outline-offset: 2px;
}

.agenticwp-toggle-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--agenticwp-text-secondary);
    border-bottom: 2px solid var(--agenticwp-text-secondary);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -2px;
}

.agenticwp-section-toggle:hover .agenticwp-toggle-icon {
    border-color: var(--agenticwp-text-primary);
}

.agenticwp-section-collapsed .agenticwp-toggle-icon {
    transform: rotate(-45deg);
    margin-top: 2px;
}

.agenticwp-section-content {
    overflow: hidden;
}

.agenticwp-section-collapsed .agenticwp-section-content {
    display: none;
}

.agenticwp-section-collapsed {
    margin-bottom: var(--agenticwp-space-lg);
}

.agenticwp-field-group {
    margin-bottom: var(--agenticwp-space-xl);
}

.agenticwp-field-group:last-child {
    margin-bottom: 0;
}

.agenticwp-field-group label {
    display: block;
    margin-bottom: var(--agenticwp-space-sm);
    font-weight: 600;
    color: var(--agenticwp-text-primary);
    font-size: 14px;
}

.agenticwp-field-group .description {
    margin-top: var(--agenticwp-space-xs);
    font-size: 13px;
    color: var(--agenticwp-text-secondary);
    line-height: 1.4;
}

.agenticwp-settings-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
}

.agenticwp-openai-config {
    display: grid;
    gap: var(--agenticwp-space-2xl);
}

.agenticwp-api-key-section {
    display: flex;
    flex-direction: column;
    gap: var(--agenticwp-space-md);
    padding: var(--agenticwp-space-xl);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--agenticwp-border);
    border-radius: var(--agenticwp-radius-lg);
    transition: var(--agenticwp-transition);
}

.agenticwp-api-key-section:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--agenticwp-border-dark);
    box-shadow: var(--agenticwp-shadow-sm);
}

.agenticwp-api-key-section .description {
    margin: 0;
    font-size: 13px;
    color: var(--agenticwp-text-secondary);
}

.agenticwp-model-selection {
    display: flex;
    flex-direction: column;
    gap: var(--agenticwp-space-lg);
}

.agenticwp-model-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--agenticwp-space-lg);
}

.agenticwp-model-card {
    display: flex;
    flex-direction: column;
    gap: var(--agenticwp-space-sm);
    padding: var(--agenticwp-space-lg);
    background: var(--agenticwp-bg-white);
    border: 2px solid var(--agenticwp-border);
    border-radius: var(--agenticwp-radius-lg);
    cursor: pointer;
    transition: var(--agenticwp-transition);
    position: relative;
    box-sizing: border-box;
}

.agenticwp-model-card:hover {
    border-color: var(--agenticwp-primary);
    box-shadow: var(--agenticwp-shadow-lg);
    transform: translateY(-2px);
}

.agenticwp-model-card.selected {
    border-color: var(--agenticwp-primary);
    background: rgba(0, 124, 186, 0.03);
    box-shadow: var(--agenticwp-shadow-primary);
}

.agenticwp-model-card input[type="radio"]:checked::before {
    margin: 0.1875rem;
}

.agenticwp-checkbox-field input[type="checkbox"]:checked::before {
    margin: -0.1875rem 0 0 -0.25rem;
    height: 1.3125rem;
    width: 1.3125rem;
}

.agenticwp-model-card-header {
    display: flex;
    align-items: center;
    gap: var(--agenticwp-space-sm);
}

.agenticwp-model-card input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.agenticwp-model-card-title {
    font-weight: 600;
    color: var(--agenticwp-text-primary);
    font-size: 16px;
    margin: 0;
}

.agenticwp-model-card-description {
    font-size: 13px;
    color: var(--agenticwp-text-secondary);
    margin: 0;
    line-height: 1.4;
}

.agenticwp-model-card-badge {
    position: absolute;
    top: var(--agenticwp-space-sm);
    right: var(--agenticwp-space-sm);
    background: var(--agenticwp-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--agenticwp-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--agenticwp-transition);
}

.agenticwp-model-card-badge.saving {
    color: #646970;
    background-color: #f0f0f1;
}

.agenticwp-model-card-badge.saved {
    color: #ffffff;
    background-color: #00a32a;
}

.agenticwp-model-card-badge.error {
    color: #ffffff;
    background-color: #d63638;
}

.agenticwp-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--agenticwp-space-2xl);
}

.agenticwp-config-field {
    display: flex;
    flex-direction: column;
    gap: var(--agenticwp-space-sm);
}

.agenticwp-config-field label {
    font-weight: 600;
    color: var(--agenticwp-text-primary);
    font-size: 14px;
    margin: 0;
}

.agenticwp-config-field .description {
    margin: 0;
    font-size: 13px;
    color: var(--agenticwp-text-secondary);
    line-height: 1.4;
}

.agenticwp-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--agenticwp-space-lg);
}

.agenticwp-api-key-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.agenticwp-key-saved {
    color: #00a32a;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.agenticwp-delete-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
    height: auto;
    line-height: 1.4;
}

.agenticwp-delete-key:disabled {
    background: #ccd0d4;
    border-color: #ccd0d4;
    color: #a7aaad;
    cursor: default;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.agenticwp-settings-columns input[type="number"],
.agenticwp-settings-columns input[type="text"],
.agenticwp-settings-columns input[type="password"],
.agenticwp-settings-columns select {
    width: 100%;
    max-width: 280px;
}

.agenticwp-field-saving {
    border-color: #007cba !important;
    box-shadow: 0 0 0 1px #007cba !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.agenticwp-field-saved {
    background-color: #00a32a !important;
    color: #ffffff !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.agenticwp-field-saved label,
.agenticwp-field-saved .description {
    color: #ffffff !important;
}

.agenticwp-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638 !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.agenticwp-save-prompts.saving {
    background-color: #00a32a !important;
    pointer-events: none;
}

.agenticwp-save-prompts.saved {
    background-color: #00a32a !important;
}

@media screen and (max-width: 1024px) {
    .agenticwp-settings-columns {
        grid-template-columns: 1fr;
        gap: var(--agenticwp-space-2xl);
    }

    .agenticwp-config-grid {
        grid-template-columns: 1fr;
        gap: var(--agenticwp-space-xl);
    }

    .agenticwp-model-cards {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 782px) {
    .agenticwp-settings-columns {
        grid-template-columns: 1fr;
        gap: var(--agenticwp-space-xl);
    }

    .agenticwp-settings-section {
        padding: var(--agenticwp-space-lg);
        margin-bottom: var(--agenticwp-space-xl);
    }

    .agenticwp-settings-section h2 {
        font-size: 18px;
        margin-bottom: var(--agenticwp-space-lg);
    }

    .agenticwp-field-group {
        margin-bottom: var(--agenticwp-space-xl);
    }

    .agenticwp-api-key-status {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--agenticwp-space-sm);
    }

    .agenticwp-delete-key {
        align-self: stretch;
        text-align: center;
    }

    .agenticwp-model-cards {
        grid-template-columns: 1fr;
        gap: var(--agenticwp-space-md);
    }

    .agenticwp-config-grid {
        grid-template-columns: 1fr;
        gap: var(--agenticwp-space-xl);
    }

    .agenticwp-options-grid {
        grid-template-columns: 1fr;
        gap: var(--agenticwp-space-md);
    }

    .agenticwp-api-key-section {
        padding: var(--agenticwp-space-lg);
    }

    .agenticwp-model-card {
        padding: var(--agenticwp-space-md);
    }

    .agenticwp-section-header {
        margin-bottom: var(--agenticwp-space-md);
    }

    .agenticwp-section-toggle {
        width: 28px;
        height: 28px;
        padding: 6px;
    }

    .agenticwp-toggle-icon {
        width: 6px;
        height: 6px;
    }
}

@media screen and (max-width: 480px) {
    .agenticwp-settings-section {
        padding: var(--agenticwp-space-md);
    }

    .agenticwp-api-key-section {
        padding: var(--agenticwp-space-md);
    }

    .agenticwp-settings-columns input[type="number"],
    .agenticwp-settings-columns input[type="text"],
    .agenticwp-settings-columns input[type="password"],
    .agenticwp-settings-columns select {
        max-width: none;
    }
}