/**
 * Admin styles for WP SAML IdP plugin
 */

.wp-saml-idp-admin-wrapper {
    margin: 20px 0;
}

.wp-saml-idp-admin-header {
    margin-bottom: 20px;
}

.wp-saml-idp-admin-header h1 {
    display: inline-block;
    margin-right: 10px;
}

.wp-saml-idp-version {
    color: #777;
    font-size: 13px;
    vertical-align: middle;
}

/* Service Provider list table */
.wp-list-table .column-toggle {
    width: 80px;
    text-align: center;
}

.wp-list-table .column-name {
    width: 25%;
}

.wp-list-table .column-entity_id {
    width: 30%;
    word-break: break-all;
}

.wp-list-table .column-acs_url {
    width: 30%;
    word-break: break-all;
}

.wp-list-table .column-actions {
    width: 120px;
    text-align: right;
}

/* Service Provider form */
.wp-saml-idp-form {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.wp-saml-idp-form h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.wp-saml-idp-form .form-table {
    margin-top: 0;
}

.wp-saml-idp-form .form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
}

.wp-saml-idp-form .form-table td {
    padding: 15px 10px;
}

.wp-saml-idp-form input[type="text"],
.wp-saml-idp-form input[type="url"],
.wp-saml-idp-form select {
    width: 400px;
    max-width: 100%;
}

.wp-saml-idp-form textarea {
    width: 100%;
    max-width: 800px;
    min-height: 150px;
    font-family: monospace;
}

.wp-saml-idp-form-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Toggle switch */
.wp-saml-idp-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.wp-saml-idp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wp-saml-idp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.wp-saml-idp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .wp-saml-idp-toggle-slider {
    background-color: #2271b1;
}

input:focus + .wp-saml-idp-toggle-slider {
    box-shadow: 0 0 1px #2271b1;
}

input:checked + .wp-saml-idp-toggle-slider:before {
    transform: translateX(26px);
}

/* Metadata display */
.wp-saml-idp-metadata {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.wp-saml-idp-metadata-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.wp-saml-idp-metadata-url {
    background: #f9f9f9;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.wp-saml-idp-metadata-url code {
    flex-grow: 1;
    margin-right: 10px;
    word-break: break-all;
}

.wp-saml-idp-metadata-xml {
    background: #f9f9f9;
    padding: 10px;
    border: 1px solid #ddd;
    max-height: 400px;
    overflow: auto;
}

.wp-saml-idp-metadata-xml pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
}

/* Certificate details */
.wp-saml-idp-certificate-details {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    margin-top: 10px;
}

.wp-saml-idp-certificate-details p {
    margin: 0 0 10px;
}

.wp-saml-idp-certificate-details p:last-child {
    margin-bottom: 0;
}

/* Tabs for attribute mapping */
.wp-saml-idp-nav-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid #ccc;
}

.wp-saml-idp-tab-content {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-top: none;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Attribute mapping table */
.wp-saml-idp-attribute-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.wp-saml-idp-attribute-table th,
.wp-saml-idp-attribute-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.wp-saml-idp-attribute-table th {
    font-weight: 600;
}

.wp-saml-idp-attribute-table tr:last-child td {
    border-bottom: none;
}

.wp-saml-idp-attribute-table input[type="text"] {
    width: 100%;
}

/* Log table */
.wp-saml-idp-log-filter {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.wp-saml-idp-log-filter label {
    margin-right: 10px;
}

.wp-saml-idp-log-filter select {
    margin-right: 10px;
}

.wp-saml-idp-log-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.wp-saml-idp-log-table th,
.wp-saml-idp-log-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.wp-saml-idp-log-table th {
    font-weight: 600;
    background: #f9f9f9;
}

.wp-saml-idp-log-table tr:last-child td {
    border-bottom: none;
}

.wp-saml-idp-log-level {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wp-saml-idp-log-level-debug {
    background: #f0f0f0;
    color: #666;
}

.wp-saml-idp-log-level-info {
    background: #e5f5fa;
    color: #0c7cd5;
}

.wp-saml-idp-log-level-warning {
    background: #fcf8e3;
    color: #8a6d3b;
}

.wp-saml-idp-log-level-error {
    background: #f2dede;
    color: #a94442;
}

.wp-saml-idp-log-time {
    white-space: nowrap;
    color: #666;
    font-size: 12px;
}

.wp-saml-idp-log-message {
    word-break: break-word;
}

.wp-saml-idp-log-context {
    font-family: monospace;
    font-size: 12px;
    color: #555;
    word-break: break-word;
}

/* Utility classes */
.wp-saml-idp-section {
    margin-bottom: 30px;
}

.wp-saml-idp-actions {
    margin-top: 15px;
}

.wp-saml-idp-button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.copy-to-clipboard {
    cursor: pointer;
    color: #0073aa;
    text-decoration: none;
}

.copy-to-clipboard:hover {
    color: #00a0d2;
}

.wp-saml-idp-pagination {
    margin-top: 15px;
    text-align: right;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-active {
    background-color: #46b450;
}

.status-inactive {
    background-color: #dc3232;
}

.wp-saml-idp-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.wp-saml-idp-section-description {
    color: #666;
    margin-bottom: 15px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .wp-saml-idp-form .form-table th {
        width: 100%;
        padding-bottom: 0;
    }
    
    .wp-saml-idp-form input[type="text"],
    .wp-saml-idp-form input[type="url"],
    .wp-saml-idp-form select {
        width: 100%;
    }
    
    .wp-list-table .column-toggle,
    .wp-list-table .column-actions {
        text-align: left;
    }
}
