/**
 * Remote Library Settings Styles
 *
 * @package AnalogWP\CustomLibrary
 */

/* Mode Selection */
.agwp-mode-options {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.agwp-mode-option {
    position: relative;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 300px;
}

.agwp-mode-option:hover {
    border-color: #2271b1;
}

.agwp-mode-option input[type="radio"] {
    position: absolute;
    top: 15px;
    right: 15px;
}

.agwp-mode-option.selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.agwp-mode-option h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.agwp-mode-option p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Connection Code Display */
.agwp-connection-code-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.agwp-connection-code-wrapper input.connection-code {
    font-family: monospace;
    font-size: 12px;
    padding: 8px 12px;
    width: 400px;
    max-width: 100%;
    background: #f6f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.agwp-copy-code {
    padding: 6px 12px;
}

/* Tables */
.agwp-connected-clients,
.agwp-connected-servers {
    margin: 15px 0;
}

.agwp-connected-clients table,
.agwp-connected-servers table {
    width: 100%;
    border-collapse: collapse;
}

.agwp-connected-clients th,
.agwp-connected-clients td,
.agwp-connected-servers th,
.agwp-connected-servers td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.agwp-connected-clients th,
.agwp-connected-servers th {
    background: #f6f7f7;
    font-weight: 600;
}

.agwp-connected-clients tr:hover,
.agwp-connected-servers tr:hover {
    background: #f9f9f9;
}

/* Status Badges */
.agwp-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.agwp-status-badge.active {
    background: #d4edda;
    color: #155724;
}

.agwp-status-badge.revoked {
    background: #f8d7da;
    color: #721c24;
}

.agwp-status-badge.error {
    background: #fff3cd;
    color: #856404;
}

/* Add Connection Form */
.agwp-add-connection-form {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 15px 0;
}

.agwp-add-connection-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.agwp-add-connection-form input[type="text"] {
    width: 100%;
    max-width: 500px;
    margin-bottom: 15px;
}

.agwp-add-connection-form .button {
    margin-top: 10px;
}

.agwp-connection-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

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

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

/* Action Buttons */
.agwp-revoke-client,
.agwp-remove-connection {
    color: #b32d2e !important;
}

.agwp-revoke-client:hover,
.agwp-remove-connection:hover {
    color: #8a2424 !important;
}

.agwp-sync-connection {
    color: #2271b1 !important;
}

/* Empty States */
.agwp-empty-state {
    text-align: center;
    padding: 30px;
    color: #666;
}

.agwp-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

/* Settings Notice */
.agwp-settings-notice {
    padding: 15px;
    margin: 15px 0;
    background: #fff;
    border-left: 4px solid #2271b1;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.agwp-settings-notice.warning {
    border-left-color: #ffb900;
}

.agwp-settings-notice.error {
    border-left-color: #dc3232;
}


/* Increased padding for table cells */
.ang-custom-library {
	.agwp-servers-table, 
	.agwp-clients-table {
		border-radius: 4px;
		td, 
		th{
			padding: 20px 15px !important;
		}
	}
}
/* Sync Status */
.sync-status {
    font-size: 12px;
    color: #666;
}

.last-sync {
    font-size: 12px;
    color: #999;
}

.last-sync .sync-time {
    color: #999;
    margin-left: 4px;
}

/* Server URL in combined column */
.server-name .server-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

/* Count Badge */
.agwp-count-badge {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    min-width: 20px;
    text-align: center;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .agwp-mode-options {
        flex-direction: column;
    }

    .agwp-mode-option {
        max-width: none;
    }

    .agwp-connection-code-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .agwp-connection-code-wrapper input.connection-code {
        width: 100%;
    }
}

/* Mode Change Notice */
.agwp-mode-change-notice {
    display: none;
    margin-top: 15px;
    padding: 10px 15px;
    background: #fff8e5;
    border-left: 4px solid #dba617;
    border-radius: 4px;
}

.agwp-mode-change-notice p {
    margin: 0;
    color: #6e4e00;
    font-size: 13px;
}
