/**
 * XML-RPC Control Dashboard Widget Styles
 *
 * @package XML_RPC_Control
 */

.xmlrpc-control-widget {
    padding: 12px;
}

.xmlrpc-status-container {
    margin-bottom: 20px;
}

/* Stacked Status Display */
.status-box {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background-color: #fff;
    margin-bottom: 15px;
    overflow: hidden;
}

.status-box-heading {
    margin: 0;
    padding: 12px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    background-color: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-box-content {
    padding: 15px;
}

.status-indicator-line {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.status-indicator-line strong {
    font-weight: 600;
}

.status-meta-line {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #646970;
    padding-left: 20px;
}

/* Dashboard widget buttons - full width */
.status-box-content .button {
    width: 100%;
    margin-top: 12px;
    justify-content: center;
    height: auto;
    padding: 10px 15px;
}

/* Manual Check Button */
.manual-check-section {
    margin-bottom: 20px;
    text-align: center;
}

.manual-check-section .button {
    width: 100%;
    justify-content: center;
    height: auto;
    padding: 10px 15px;
}

/* Email Notifications */
.email-notifications {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.email-notifications label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 8px;
}

.email-notifications input[type="checkbox"] {
    margin-right: 8px;
}

.email-notifications .description {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Rate Limiting Info */
.rate-limiting-info {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.rate-limiting-info .description {
    margin: 0;
    font-size: 13px;
}

.rate-limiting-info a {
    text-decoration: none;
}

/* Widget Footer */
.xmlrpc-widget-footer {
    padding-top: 15px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.xmlrpc-widget-footer .button {
    width: 100%;
    justify-content: center;
}

/* Button States */
.xmlrpc-toggle-btn.processing,
.xmlrpc-check-now-btn.processing {
    opacity: 0.6;
    cursor: not-allowed;
}

.xmlrpc-toggle-btn:disabled,
.xmlrpc-check-now-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .xmlrpc-control-widget {
        padding: 8px;
    }

    .status-box-content,
    .manual-check-section,
    .email-notifications,
    .rate-limiting-info {
        padding: 12px;
    }
}

/* Loading spinner for buttons */
.xmlrpc-toggle-btn.processing::before,
.xmlrpc-check-now-btn.processing::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Settings Page Styles
   ========================================================================== */

.card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Settings page buttons - auto width, not full width */
.card .button.xmlrpc-toggle-btn,
.card .button.rate-limiting-toggle-btn {
    width: auto;
    display: inline-block;
}

/* Tooltip Component */
.xmlrpc-tooltip-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 4px;
}

.xmlrpc-tooltip-icon {
    font-size: 16px;
    vertical-align: middle;
    color: #007bff;
    cursor: help;
}

.xmlrpc-tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 400px;
    max-width: 90vw;
    background-color: #2c3338;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 12px 15px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -200px;
    transition: opacity 0.2s, visibility 0.2s;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.xmlrpc-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3338 transparent transparent transparent;
}

.xmlrpc-tooltip-wrapper:hover .xmlrpc-tooltip-text {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 768px) {
    .xmlrpc-tooltip-text {
        width: 280px;
        margin-left: -140px;
    }
}
