/**
 * Floyi Connect Admin Styles
 *
 * @package Floyi_Connect
 */

/* ==========================================================================
   Settings Page Layout
   ========================================================================== */

.floyi-connect-settings {
    max-width: 800px;
    margin: 20px 0;
}

.floyi-connect-settings h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.floyi-connect-settings h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #2271b1;
}

/* ==========================================================================
   Connection Status Card
   ========================================================================== */

.floyi-connection-status {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
}

.floyi-connection-status h2 {
    margin: 0 0 16px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.floyi-status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.floyi-status-indicator.connected {
    background: #edfaef;
    border: 1px solid #46b450;
}

.floyi-status-indicator.disconnected {
    background: #fcf0f1;
    border: 1px solid #d63638;
}

.floyi-status-indicator.pending {
    background: #fff8e5;
    border: 1px solid #dba617;
}

.floyi-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.floyi-status-indicator.connected .floyi-status-dot {
    background: #46b450;
    box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.2);
}

.floyi-status-indicator.disconnected .floyi-status-dot {
    background: #d63638;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.2);
}

.floyi-status-indicator.pending .floyi-status-dot {
    background: #dba617;
    box-shadow: 0 0 0 3px rgba(219, 166, 23, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.floyi-status-text {
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
}

.floyi-status-details {
    font-size: 13px;
    color: #50575e;
    margin-top: 8px;
}

.floyi-status-details p {
    margin: 4px 0;
}

/* ==========================================================================
   Connection Code Section
   ========================================================================== */

.floyi-connection-code-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
}

.floyi-connection-code-section h2 {
    margin: 0 0 12px;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.floyi-connection-code-section p {
    margin: 0 0 16px;
    color: #50575e;
    font-size: 13px;
}

.floyi-code-display {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.floyi-code-value {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #1d2327;
    background: #f6f7f7;
    padding: 12px 20px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.floyi-code-expiry {
    font-size: 13px;
    color: #50575e;
}

.floyi-code-expiry.expired {
    color: #d63638;
}

.floyi-code-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Connection Info
   ========================================================================== */

.floyi-connection-info {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
}

.floyi-connection-info h2 {
    margin: 0 0 16px;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.floyi-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.floyi-info-item {
    padding: 12px;
    background: #f6f7f7;
    border-radius: 4px;
}

.floyi-info-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
    margin-bottom: 4px;
}

.floyi-info-value {
    font-size: 14px;
    color: #1d2327;
    word-break: break-word;
}

/* ==========================================================================
   Instructions Card
   ========================================================================== */

.floyi-instructions {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
}

.floyi-instructions h2 {
    margin: 0 0 16px;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.floyi-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.floyi-instructions li {
    margin-bottom: 12px;
    color: #50575e;
    font-size: 14px;
    line-height: 1.5;
}

.floyi-instructions li strong {
    color: #1d2327;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.floyi-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.floyi-button-primary {
    background: #2271b1;
    border: 1px solid #2271b1;
    color: #fff;
}

.floyi-button-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.floyi-button-secondary {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    color: #2271b1;
}

.floyi-button-secondary:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #135e96;
}

.floyi-button-danger {
    background: #d63638;
    border: 1px solid #d63638;
    color: #fff;
}

.floyi-button-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
    color: #fff;
}

.floyi-button:disabled,
.floyi-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.floyi-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.floyi-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.floyi-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Notices
   ========================================================================== */

.floyi-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.floyi-notice-success {
    background: #edfaef;
    border: 1px solid #46b450;
    color: #1e4620;
}

.floyi-notice-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #8a1f1f;
}

.floyi-notice-warning {
    background: #fff8e5;
    border: 1px solid #dba617;
    color: #6e4f1a;
}

.floyi-notice-info {
    background: #f0f6fc;
    border: 1px solid #72aee6;
    color: #1d4ed8;
}

.floyi-notice .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 782px) {
    .floyi-connect-settings {
        margin: 10px;
    }

    .floyi-code-display {
        flex-direction: column;
        align-items: flex-start;
    }

    .floyi-code-value {
        font-size: 20px;
        padding: 10px 16px;
    }

    .floyi-info-grid {
        grid-template-columns: 1fr;
    }

    .floyi-code-actions {
        flex-direction: column;
    }

    .floyi-button {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Settings Page (Token Connection Flow)
   ========================================================================== */

.floyi-settings {
    max-width: 800px;
}

.floyi-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.floyi-card h2 {
    margin-top: 0;
}

.floyi-status {
    padding: 10px 15px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.floyi-status-connected {
    background: #d4edda;
    color: #155724;
}

.floyi-status-disconnected {
    background: #fff3cd;
    color: #856404;
}

.floyi-steps {
    margin-left: 20px;
    margin-bottom: 20px;
}

.floyi-steps li {
    margin-bottom: 8px;
}

.floyi-connection-form {
    margin-top: 20px;
}

.floyi-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.floyi-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.floyi-token-input {
    font-size: 18px;
    font-family: monospace;
    letter-spacing: 2px;
    padding: 10px 15px;
    width: 220px;
    text-transform: uppercase;
    border: 2px solid #c3c4c7;
    border-radius: 4px;
}

.floyi-token-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.floyi-hint {
    color: #666;
    font-size: 13px;
    margin-top: 8px;
}

.floyi-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 15px;
}

#floyi-connect-btn {
    padding: 8px 20px;
    height: auto;
}
