/**
 * PartnerID Validator Plugin Styles
 */

/* Main container */
.partnerid-container {
    max-width: 600px;
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
}

/* Form styles */
.partnerid-form {
    margin-bottom: 20px;
}

.partnerid-form .form-row {
    margin-bottom: 15px;
}

.partnerid-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.partnerid-form input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.partnerid-form button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.partnerid-form button:hover {
    background-color: #005a87;
}

/* Status displays */
.partnerid-status {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.partnerid-status.valid {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.partnerid-status.invalid {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

.partnerid-status p {
    margin: 0 0 10px 0;
    padding: 0;
}

/* Test mode styles */
.partnerid-test-mode-notice {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
    border-radius: 3px;
    font-size: 14px;
}

/* Mode indicators */
.partnerid-mode {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.partnerid-mode.test-mode {
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
}

.partnerid-mode.live-mode {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.partnerid-no-action {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

.partnerid-force-delete-notice {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
    font-style: italic;
    color: #d9534f;
}

/* API Logs styles */
.api-logs-overview {
    margin-top: 30px;
    border-top: 1px solid #e5e5e5;
    padding-top: 20px;
}

.log-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.log-status.success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.log-status.error {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

/* Enhanced API Logs Table */
.api-logs-table {
    table-layout: auto !important;
}

.api-logs-table .column-id {
    width: 50px;
}

.api-logs-table .column-timestamp {
    width: 150px;
}

.api-logs-table .column-method {
    width: 70px;
}

.api-logs-table .column-user {
    width: 120px;
}

.api-logs-table .column-status {
    width: 100px;
}

.api-logs-table .column-ip {
    width: 150px;
}

.api-logs-table .column-url {
    width: 15%;
}

.api-logs-table .column-parameters,
.api-logs-table .column-response {
    width: 20%;
}

/* API response and parameter formatting */
.parameter-preview,
.response-preview {
    max-width: 100%;
    max-height: 150px;
    overflow: auto;
    padding: 8px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
    font-size: 12px;
    word-break: break-all;
}

.parameter-details {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.4;
    color: #444;
}

.parameter-key-value {
    margin-bottom: 6px;
    padding: 4px 2px;
    border-bottom: 1px solid #f0f0f0;
}

.parameter-key-value:last-of-type {
    border-bottom: none;
}

.parameter-value {
    font-family: Consolas, Monaco, monospace;
    word-break: break-all;
}

.hash-value {
    font-size: 11px;
    color: #777;
}

.raw-toggle {
    margin-top: 10px;
    font-size: 12px;
    text-align: right;
}

.raw-toggle a {
    text-decoration: none;
    color: #0073aa;
}

.raw-toggle a:hover {
    color: #00a0d2;
}

.raw-data {
    margin-top: 8px;
    border-top: 1px dotted #ddd;
    padding-top: 8px;
}

.parameter-preview pre,
.response-preview pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 12px;
}

/* Special formatting for error messages */
.api-error-message {
    color: #a94442;
    background-color: #ffeeee;
    padding: 5px;
    border-left: 3px solid #a94442;
    font-weight: bold;
}

.api-json {
    font-size: 12px;
    font-family: monospace;
    color: #333;
    background: #f9f9f9;
    line-height: 1.4;
    margin: 0;
    padding: 8px;
    white-space: pre-wrap;
}

.url-wrapper {
    word-break: break-all;
    max-width: 100%;
    font-size: 12px;
}

/* Messages */
.partnerid-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.partnerid-success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.partnerid-error {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

/* Style for the "already registered" error message */
.partnerid-error.already-registered {
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
    font-weight: bold;
}

.partnerid-loading {
    display: none;
    text-align: center;
    padding: 10px;
}

/* Admin styles */
.partnerid-admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.partnerid-admin-table th, 
.partnerid-admin-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.partnerid-admin-table th {
    background-color: #f5f5f5;
}

/* Elementor compatibility */
.elementor-widget-partnerid-checker .partnerid-container {
    margin: 0;
}

/* Responsive design */
@media screen and (max-width: 782px) {
    .api-logs-table .column-id,
    .api-logs-table .column-method,
    .api-logs-table .column-user,
    .api-logs-table .column-ip {
        display: none;
    }
    
    .api-logs-table .column-timestamp,
    .api-logs-table .column-url,
    .api-logs-table .column-parameters,
    .api-logs-table .column-status,
    .api-logs-table .column-response {
        display: table-cell;
    }
    
    .parameter-preview,
    .response-preview {
        max-height: 100px;
    }
}

@media screen and (max-width: 480px) {
    .partnerid-form button {
        width: 100%;
    }
    
    .api-logs-table .column-parameters {
        display: none;
    }
}

/* Documentation styles */
.documentation-container .card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    margin-top: 20px;
    padding: 15px 25px;
    border-radius: 3px;
}

.documentation-container h2 {
    font-size: 1.5em;
    margin-top: 0.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5em;
}

.documentation-container h3 {
    font-size: 1.2em;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.documentation-container h4 {
    font-size: 1.1em;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.documentation-container ul, 
.documentation-container ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

.documentation-container ul li, 
.documentation-container ol li {
    margin-bottom: 0.5em;
}

.documentation-container code {
    background: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.documentation-container pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 3px;
    overflow: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid #ddd;
}

.documentation-container .back-button {
    margin-top: 20px;
}

/* Role selector styles */
.partnerid-roles-selector {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-top: 5px;
}

.partnerid-roles-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
}

.partnerid-roles-selector input[type="checkbox"] {
    margin-right: 5px;
}

.partnerid-access-notice {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    font-style: italic;
}

/* API Logs Filter Styles */
.api-logs-filter {
    margin: 10px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.api-logs-filter h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: bold;
}

.api-logs-filter .filter-row {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.api-logs-filter label {
    min-width: 120px;
    margin-right: 10px;
    font-weight: 500;
}

.api-logs-filter select {
    min-width: 200px;
    margin-right: 10px;
    max-width: 300px;
}

.api-logs-filter input[type="text"] {
    width: 250px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.api-logs-filter .search-container {
    display: flex;
    flex-grow: 1;
    align-items: center;
    margin-right: 10px;
}

.api-logs-filter .search-container input[type="text"] {
    flex-grow: 1;
    margin-right: 5px;
    width: auto;
}

.api-logs-filter .filter-actions {
    display: inline-block;
}

.api-logs-filter .button {
    margin-right: 5px;
}

.user-filter-highlight {
    font-weight: bold;
    color: #0073aa;
}

@media screen and (max-width: 782px) {
    .api-logs-filter .filter-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .api-logs-filter label,
    .api-logs-filter select,
    .api-logs-filter input[type="text"] {
        margin-bottom: 8px;
        width: 100%;
    }
    
    .api-logs-filter .filter-actions {
        margin-top: 5px;
    }
}

/* Search highlight style */
.search-highlight {
    background-color: #ffff99;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

/* Registered PartnerIDs styles */
.registry-container {
    margin-top: 20px;
}

.registry-container .wp-list-table {
    margin-top: 15px;
    margin-bottom: 15px;
}

.registry-container .back-button {
    margin-top: 20px;
}

.partnerid-registry-empty {
    font-style: italic;
    color: #666;
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* Response details styling */
.response-details {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.4;
    color: #444;
}

.response-status, .response-body, .response-item {
    margin-bottom: 6px;
    padding: 4px 2px;
    border-bottom: 1px solid #f0f0f0;
}

.response-item:last-of-type {
    border-bottom: none;
}

.response-value {
    font-family: Consolas, Monaco, monospace;
    word-break: break-all;
}

.status-code {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.status-code.success {
    background-color: #dff0d8;
    color: #3c763d;
}

.status-code.error {
    background-color: #f2dede;
    color: #a94442;
}

/* Settings navigation styles */
.settings-navigation {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.settings-navigation h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #23282d;
}

.settings-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0 0 0;
    padding: 0;
}

.settings-links li {
    list-style: none;
    margin: 0;
}

.settings-links .button {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    font-size: 14px;
    height: auto;
    min-width: 200px;
}

.settings-links .dashicons {
    margin-right: 8px;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

@media screen and (max-width: 782px) {
    .settings-links {
        flex-direction: column;
    }
    
    .settings-links li {
        width: 100%;
    }
    
    .settings-links .button {
        width: 100%;
        justify-content: flex-start;
    }
} 