/* OWH Domain WHOIS RDAP - Admin Styles */

/* Layout 2x2 forçado para as abas dos blocos */
.owh-rdap-block-tabs .components-tab-panel__tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    width: 100% !important;
}

p{
    text-wrap: balance;
}

.owh-rdap-block-tabs .components-tab-panel__tabs .components-button {
    margin: 0 !important;
    border-radius: 6px !important;
    border: 1px solid #ddd !important;
    padding: 10px 8px !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    min-height: 42px !important;
    max-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f7f7f7 !important;
    color: #555 !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
}

.owh-rdap-block-tabs .components-tab-panel__tabs .components-button:hover {
    background: #e8f4fd !important;
    border-color: #0073aa !important;
    color: #0073aa !important;
}

.owh-rdap-block-tabs .components-tab-panel__tabs .components-button.is-active {
    background: #0073aa !important;
    border-color: #0073aa !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2) !important;
}

/* Garantir que sempre seja 2x2, mesmo com número ímpar de abas */
.owh-rdap-block-tabs .components-tab-panel__tabs .components-button:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.owh-rdap-block-tabs .components-tab-panel__tabs .components-button:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.owh-rdap-block-tabs .components-tab-panel__tabs .components-button:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
}

.owh-rdap-block-tabs .components-tab-panel__tabs .components-button:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
}

/* Para casos com mais de 4 abas (como o bloco de resultados que tem 6) */
.owh-rdap-block-tabs .components-tab-panel__tabs .components-button:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
}

.owh-rdap-block-tabs .components-tab-panel__tabs .components-button:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
}

.owh-rdap-admin-container {
    max-width: 1200px;
    margin: 20px 0;
}

.owh-rdap-admin-header {
    margin-bottom: 30px;
}

.owh-rdap-admin-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 20px;
}

.owh-rdap-admin-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.owh-rdap-setting-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.owh-rdap-setting-label {
    flex: 0 0 200px;
    font-weight: 600;
}

.owh-rdap-setting-control {
    flex: 1;
}

.owh-rdap-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.owh-rdap-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.owh-rdap-help-text {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
}

.owh-rdap-update-section {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.owh-rdap-update-section h4 {
    margin-top: 0;
    color: #0073aa;
}

.owh-rdap-shortcode-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.owh-rdap-shortcode-info h3 {
    margin-top: 0;
    color: #333;
}

.owh-rdap-shortcode-list {
    margin: 0;
    padding-left: 20px;
}

.owh-rdap-shortcode-list li {
    margin-bottom: 8px;
    color: #666;
}

.owh-rdap-shortcode-list strong {
    color: #0073aa;
    font-family: monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

#update-rdap-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 3px;
    display: none;
}

#update-rdap-status.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#update-rdap-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

#update-rdap-status.loading {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Gutenberg Block Tabs Styles */
.owh-rdap-block-tabs .components-tab-panel__tab-content {
    padding-top: 16px;
}

.owh-rdap-block-tabs .components-tab-panel__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 0;
    background: #f6f7f7;
    border-radius: 6px 6px 0 0;
    padding: 4px;
}

.owh-rdap-block-tabs .components-button {
    flex: 1;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: none;
    color: #757575;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    min-height: auto;
}

.owh-rdap-block-tabs .components-button:hover {
    background: #e0e0e0;
    color: #1e1e1e;
}

.owh-rdap-block-tabs .components-button.is-active {
    background: #007cba;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 124, 186, 0.3);
}

.owh-rdap-block-tabs .components-button.is-active:hover {
    background: #005a87;
}

/* Panel body customization */
.owh-rdap-block-tabs .components-panel__body {
    border: none;
    margin: 0;
}

.owh-rdap-block-tabs .components-panel__body-title {
    margin-bottom: 16px;
    color: #1e1e1e;
    font-weight: 600;
}

/* Color picker improvements */
.owh-rdap-block-tabs .components-color-picker {
    max-width: 200px;
}

/* Range control improvements */
.owh-rdap-block-tabs .components-range-control {
    margin-bottom: 16px;
}

.owh-rdap-block-tabs .components-range-control__wrapper {
    margin-left: 0;
}

/* Textarea improvements */
.owh-rdap-block-tabs .components-textarea-control textarea {
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* Toggle control spacing */
.owh-rdap-block-tabs .components-toggle-control {
    margin-bottom: 16px;
}

/* Text control spacing */
.owh-rdap-block-tabs .components-text-control {
    margin-bottom: 16px;
}

/* Preview icon area */
.owh-rdap-icon-preview {
    border: 2px dashed #ddd;
    border-radius: 4px;
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
}

/* Responsive tabs */
@media (max-width: 782px) {
    .owh-rdap-setting-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .owh-rdap-setting-label {
        flex: none;
    }
    
    .owh-rdap-block-tabs .components-tab-panel__tabs {
        flex-direction: column;
    }
    
    .owh-rdap-block-tabs .components-button {
        text-align: left;
        justify-content: flex-start;
    }
}
